Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2090250lqe; Tue, 9 Apr 2024 09:14:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVlZvjte+aP3tLqSNB9DwVscWjiKBXI7D9UCThebU0jSUSKZTuGUNMgy1YC1XxOkehQNKubaBCSMSRuHPxEloztC/k5uohxvhHFjsm8w== X-Google-Smtp-Source: AGHT+IF3enKZLukjWXK1SBAPfi8PoNU9ly3tEui/fzzh2GACssT87WCE3QnYNP4UIaQTJkG6Gooa X-Received: by 2002:a05:6359:1907:b0:186:3c3:b412 with SMTP id mf7-20020a056359190700b0018603c3b412mr439229rwb.0.1712679241386; Tue, 09 Apr 2024 09:14:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712679241; cv=pass; d=google.com; s=arc-20160816; b=P52wTquDkLl6Fvrve9oPsDHmXOdBqKTOb+UtAtAklHOvqpZ/sFAwuzEhkjI7l3+Bml 0iLrg7GDJWqqcFzWSrCOTAeMAdWfBccY0F71qCidOv54M8YdA76OK8pozwtdHLW04S8n DYEP/rdHm0Kk762Tx71a6K0p+IM2e18ZqNXGLvtjQ3M0cF++EK4cKOhLg3ceiKKe7p1U HLhvsVvnd04wdcRNo9naOaaOqZ7dJmYn/K3XdF5QIPDa3EZ7o8wTPT5rANTpJaK2eOnT PSB+ZezKUnt+khl3IPNHA00GCf22W5xzPj8Zrv0co6g4FM4UBNWhaKO3Qto3WEC6zjNZ LyHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=MOWg4N/uj5tfTqRavr+BuhU1b337OJgyImx/PZQedGc=; fh=CDG6u9ZDTz3vJFCAXxGiqkqZzA0zUZsVx+xrkfNujMU=; b=fw3qwwuZRCl4Guuj8r4XH8Bf9aoMBflLs1BBSIXuzEceXdQhrtjqH+Uxf+kC0PiyaH 8l8R8aKfRlGLMGrKKtoFqlHJuqCq4ciwSCUr2Cnv1VVMEhUjw8au9tDGYQ1k7xOlI8tP Jo0ctFJHHekOBUtzT+Fu7VDGcxuLvZBkXxgdjOkce3EF5sAHB+SEvirYd4EpnH/5cOgH oMfTUdMPnvzRFgHpA44sNaVmrGdtBAWfXt3ebAFNLd580KX3L2BUcHXWnQGxX4BqVu1r KPssgIwMxIYsT++eQT85G2caB5gHxyj7zKKRW9zY8dHI9INJ4bp5gMnpbqx+Lyfqb+rl kTsA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pnGODQoN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i24-20020a635858000000b005f0a53a29d4si8781650pgm.730.2024.04.09.09.14.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 09:14:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pnGODQoN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-137222-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137222-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A8E8AB30C9A for ; Tue, 9 Apr 2024 15:30:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73F6813D8A5; Tue, 9 Apr 2024 15:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pnGODQoN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6007013D891; Tue, 9 Apr 2024 15:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676396; cv=none; b=BKD7McxvEnjEvYjqpNBGbFboag0x6b4A1HWNe/Z23klNOK9zFdxRzq9bHWH5fNooxC3La5RhEtQUeZAdEz4ECG8CQpHa1ErRQR38nVgjwz09PHaOuIw9dbYwcvmWenEmIo115zE3npxAvCCCp8uoKJyhlyKJZgtI9shnZCPnlzY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712676396; c=relaxed/simple; bh=OymyiDNf4YW49xGrZ+gXBk6psnOk8MiiogrmhOiNcXg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K4hKoWXG1QNuKF9Rym8cntA8fiIYJgSMVKIf1/yDesfEMoq4WP1zSJGIQICU7iT2JuVmpJ17CO6WZ0YiEaDv5SxPPR8Y2HEzkeg7q9X1OjbLbnh/c4j5Gq/ueKOcoZ2LY/qwaydszvUCiCkqo2gLttPILkDIqE1JKNxH6FpPMYc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pnGODQoN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81708C43390; Tue, 9 Apr 2024 15:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712676395; bh=OymyiDNf4YW49xGrZ+gXBk6psnOk8MiiogrmhOiNcXg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pnGODQoNm1sF/Hwhx/x6or1eK83G+5sisNDHVxdxJib16K/EkjwscrCNNcJbXBP9K 35TjBkFXzRRF1C6IVMk3h24ux8P4mWOm1oSxWPCfECO+KsVry/8YDIvdUKP+NK9RuS tQzBy6VAN5YnfIR7dkvXtSA0eAJGGC8gHkLdcHVde3aFcp1yoX8NQNg/hGQVrZG5Lq SF/ETWwUnfmiE35TDlMU8pvp1GK7jK+yREt6ial+dqfOIAq1kfjWg3VN6MwdaFLBrw snfonA8cFCTX5ItW8G+zR+Bi8CWGhlVoJg5njGzbjhOWLfmklvncL1/i1W1WnpPB8G hDTKD5GwIbFYg== Date: Tue, 9 Apr 2024 16:26:28 +0100 From: Will Deacon To: Xu Yang Cc: frank.li@nxp.com, mark.rutland@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, john.g.garry@oracle.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, mike.leach@linaro.org, peterz@infradead.org, mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, adrian.hunter@intel.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, imx@lists.linux.dev Subject: Re: [PATCH v8 3/8] perf: imx_perf: let the driver manage the counter usage rather the user Message-ID: <20240409152627.GA23621@willie-the-truck> References: <20240322063930.749126-1-xu.yang_2@nxp.com> <20240322063930.749126-3-xu.yang_2@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240322063930.749126-3-xu.yang_2@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Fri, Mar 22, 2024 at 02:39:25PM +0800, Xu Yang wrote: > In current design, the user of perf app needs to input counter ID to count > events. However, this is not user-friendly since the user needs to lookup > the map table to find the counter. Instead of letting the user to input > the counter, let this driver to manage the counters in this patch. I think we still have to support the old interface so that we don't break those existing users (even if the driver just ignores whatever counter ID is provided in a backwards-compatible way). > This will be implemented by: > 1. allocate counter 0 for cycle event. > 2. find unused counter from 1-10 for reference events. > 3. allocate specific counter for counter-specific events. > > In this patch, counter attribute is removed too. To mark counter-specific > events, counter ID will be encoded into perf_pmu_events_attr.id. > > Reviewed-by: Frank Li > Signed-off-by: Xu Yang > > --- > Changes in v6: > - new patch > Changes in v7: > - no changes > Changes in v8: > - add Rb tag > --- > drivers/perf/fsl_imx9_ddr_perf.c | 168 ++++++++++++++++++------------- > 1 file changed, 99 insertions(+), 69 deletions(-) > > diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c > index 0017f2c9ef91..b728719b494c 100644 > --- a/drivers/perf/fsl_imx9_ddr_perf.c > +++ b/drivers/perf/fsl_imx9_ddr_perf.c > @@ -245,14 +249,12 @@ static const struct attribute_group ddr_perf_events_attr_group = { > .attrs = ddr_perf_events_attrs, > }; > > -PMU_FORMAT_ATTR(event, "config:0-7"); > -PMU_FORMAT_ATTR(counter, "config:8-15"); > +PMU_FORMAT_ATTR(event, "config:0-15"); Sadly, this is a user-visible change so I think it will break old tools, won't it? Will