From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 04319C67861 for ; Tue, 9 Apr 2024 15:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/KUxKW3xrl988ciY6SzGXc6j0L7WaMIMksikv6M9U90=; b=wXkT9dpiIXvNHV qcYjZwT4hny8ScJpU5oaxJaGDUKzMOs6xrpUKX5zyGXGU4+71/u5FHcIt09LEqw689Eox7vMIHktl QcGRocMvqbBRvp2/cMtwDQWrlKFmHzKRWtH3VM0Gevxmx5kLJJewRflQknKTntLSSObbj6d9c+63H nQFR+JNfHIPmFZvjfxSCT5KiVy5ACjrsApu5K/7IaCrm+3CuSR/Sz/uX8drKFM+7ZFbM3tqzWI6Bc ck/Gv9O2hoBbGokedcEbsN2m2+pTmBOB2XKRgksxvr1Z11iJ45JHzxU1o0VqYua7/67JecDzAon5q nuNnf+sCVwWkVgUnaW3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruDN9-00000002hTr-3t7t; Tue, 09 Apr 2024 15:26:55 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruDN1-00000002hNx-3kja for linux-arm-kernel@lists.infradead.org; Tue, 09 Apr 2024 15:26:49 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 487E0CE20F6; Tue, 9 Apr 2024 15:26:36 +0000 (UTC) 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240322063930.749126-3-xu.yang_2@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240409_082648_237440_1A71B017 X-CRM114-Status: GOOD ( 21.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel