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 62DB3CD11C2 for ; Wed, 10 Apr 2024 16:36:25 +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:MIME-Version:In-Reply-To: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=aDMEgeYYwvcy+VdMQKv9d1zKAk3s7NZ+4pJOxihH8rE=; b=A1agGDZtZZstm9 UldGqdiAZNMdIsST4RpUnueFDy3S/Yv3gsoPVxjrQJPoQHUPQzSurX0mBNuAO3rSEEEsK+VChGgLb ze3UQC4RNq9MtyUxnvdwR+im9xZwiq7qsH3yU4WMyAkAn1p6ZZWXOZac/x7rCivP6Nw/Y/AW5elzW FdNrDL0M8j8PVTc0EgKVHnnh9jJBLrReSgWjqIJZlAkkgOXADcXjuXPq0uhcbaIOOFEzZogyayyTU p4neXMjVQP1XS+aPZgUukO9SSEcrjDm7zJ/4+VniiAYXLpK11qWZRCtaHrKeIxEd7FcUPhqbXA8tQ +SoNiCcdXNNZy016nubA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruavj-000000082v6-46G7; Wed, 10 Apr 2024 16:36:11 +0000 Received: from mail-am7eur03on20701.outbound.protection.outlook.com ([2a01:111:f403:260e::701] helo=EUR03-AM7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruavf-000000082pt-3w0F for linux-arm-kernel@lists.infradead.org; Wed, 10 Apr 2024 16:36:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VPfu1s2Os2olOBdRNt9oi1KiZKwGJugtzKvWY8B/zdKW3794g21wOZR3obGGtFE2KRBdbbbjHM8c6F3tJuIQ+2l9ItXXwEcPXSZ2YWehA3Llx2XJkjpLLvBc5BUzNHtMLWIQmoIOLignpUu8J33RAykV8AtFECwdG2F6Ivnm6Z2TP/YCvUYFCROz6noJmKGUuRHo0oiJrXe0L9Jl8kI8cx+KK2MOfXFND8b8X66g/8iLNEtq/3PZf8eGlsdS4WQ9SFK+1IKKaeS8Vb3uGV3DNAzhs6OtpvVVMBTQlOps9o6MTdpgVVJ0Fpo/m6phvrz97tNrFHxp4c5Wtd23R/WnXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dNDT8d2lq2iWjo1rdorTyo9MCI56lfg+PWhx+mrBj4E=; b=nteNsa+85Pk9aGWGlYv1DuGVuvh1iSX7DLtDpYHPuMk6EFqd1JLRh/2lbHIgmf4AdMZpagR5EkiEULMnc073T98RkTnI7HLXQlmq6rYbXZAX0jk0RhmCdOtZonEMH0J83+wprbfpQLMP+RoWuQPKXwqJ3pnshjfgb0ZJ/kiXOiQJx5s8j+8XAXNZkiZhVxIj8/eFpcEOdISVTNrFAJJc0ukojOb4JiQdL37j/QZ5Gww+P+so9nzn7u7/gfW4fD8uya6CyvqReL8MdMl9/Sj7e5DM/EUtaPdNGGhif/T4soP6DhyOWP22VlbEPBQz6K4BpcPRQIitjRyeWHoxVyHJUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dNDT8d2lq2iWjo1rdorTyo9MCI56lfg+PWhx+mrBj4E=; b=iwLCy8ItaSm9BQhfWfMBSYC8RYpyHot2lp/UhaVWhjpPNoPe43JU68nE6u4z1q7REvn0Booei28f8VacQnNvYVafl49oXBf7vR4eYpAdL7iz80mgalM1D4Y1ePb3XdkhKLu3FHtib4qb2usEHggQeVU0E5jy/ga8C5lLcf/cwmg= Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by PAXPR04MB8638.eurprd04.prod.outlook.com (2603:10a6:102:21d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.53; Wed, 10 Apr 2024 16:35:52 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::3168:91:27c6:edf6]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::3168:91:27c6:edf6%3]) with mapi id 15.20.7409.042; Wed, 10 Apr 2024 16:35:52 +0000 Date: Wed, 10 Apr 2024 12:35:42 -0400 From: Frank Li To: Will Deacon Cc: Xu Yang , "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: [EXT] Re: [PATCH v8 3/8] perf: imx_perf: let the driver manage the counter usage rather the user Message-ID: References: <20240322063930.749126-1-xu.yang_2@nxp.com> <20240322063930.749126-3-xu.yang_2@nxp.com> <20240409152627.GA23621@willie-the-truck> <20240410154546.GA25225@willie-the-truck> Content-Disposition: inline In-Reply-To: <20240410154546.GA25225@willie-the-truck> X-ClientProxiedBy: SJ0PR13CA0114.namprd13.prod.outlook.com (2603:10b6:a03:2c5::29) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PAXPR04MB8638:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZZWBsf7UAMEK0GPvLzk4ie7u1j1K+A4e0ekgLRtppIlWzRLM/hj0QLsSOmW5EQNl/PU6IV/ahpOusSWpvive4H/LVQ1+UPlPmA8VNT+hMRRDqUEZS8Xvsv8LIg/4cJNyWwe14XPBF03xfq+VGRS/hZ7IdkQYfJeH7ZWaR4GqIGbCbbx1vh7T54cbKhbs0Nuo1OKg6Emes/5e6+5ue11EhndkC9n9s912XbYUdsrGLLCodxlag+BKCLhvZzcPTUyU4Nq5b5j4rAyR0SUUH3E+tfhpOVwjgueV09lz+ohAXY0tCYqn2ZbyV9zFcrx9bfoLOPG8e9T1d4OL/U6O+4DC8ALW+9YZluXcyvVfbXXz8Vk11u5QGD03HkelyaHm/IUDnskVpdN3FvHdCHbTW6tahpuK7+6fSmoMl7e+rx/lGm1TA1yOmdx5dQ7mwvGvXQsuGiHP7MNtwqExGviCnkEmlE88GBr8erZyPpKfaDjfDgYNQjbf1FrgnAWDTgahzCHqosRNSderx8IfDjty/ufdBO+Kye+m1+pX/Y5R8+n48gpMlt3be4uxmhBh++sU5+5Lcq2jm7D3H/cZnN1Vtayn/8MByBALboCFGL1TQ7VAQ8PK0lMfLFvNrt7uFoJXn/LMxkHLdpDgUO2LSEyBGdo24Tt/HGku2VMqdi1UQlZFKPwBwRWfSGAfgY4oKRix/f+2PKmnIFzUs//DP3VsVnTvnw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(1800799015)(7416005)(376005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?kaz5WuQ6C0wcmX0BR1iuc5kwpxUxKWkeQ3VEpDg6S24rqxyufcjvnZUAO5XY?= =?us-ascii?Q?t8JW8onf+NiSst2yI13gc6bk1mOptIVn34r/4AbLQNbc+EbXJxRyVga41GAk?= =?us-ascii?Q?B3AaV0O8nl3TQqCO8JPwhf1/TWG1IxyC6a88EOB+z/vD4SefPb7ecMycyMiE?= =?us-ascii?Q?LRHeETFQ0Yjig7MYo9LxWV43SWMMoooIvs7bxgBKKrunZGRr24GVem6F8JOm?= =?us-ascii?Q?XspmdrAOKbX63PDTgZHo1SEmP+Gwf5WQa5ZGsxUviCeltrwpYF9qFJSpAMhE?= =?us-ascii?Q?FN6FAGhPAnFUyPnvv2aP5OeeJhqX2wJLSATPp8C6RhRzrKECPptP9e9k3mz6?= =?us-ascii?Q?kG1xOG9fN04JZs1FwPSLGx4int1zKtFYJ3xDduw2ZeBE+cJc6+gs0GjyJaTY?= =?us-ascii?Q?m0flVELjFp4M61xl0WvPGR94RAXoSwD2ncw9t4colLdL0Fi8ccbZEtAxstnf?= =?us-ascii?Q?ZMZBfxHgd8Y04p0Q2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F?= =?us-ascii?Q?KYffuOjAYx+b5jY6wu6YXjz4Zog1V0ASz9M20F+Ya8UqzZsGUj8GYLmUaAxk?= =?us-ascii?Q?+sSB/exRzipuTZYDmTHS7B8TKcB9YqWMUGFf6P7N+t4LbtNckfMeaRlCukfP?= =?us-ascii?Q?q7eYbkAWIDcCeBgftDHiDomVuQf+NdODCzfrjEpjKkyhZRgdvoo8ULbA1cWq?= =?us-ascii?Q?VwCTgYdZ3PHP4gSxss9+AWI3jXRRojSyMYw3w22F?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49a15624-7b81-46a2-bea8-08dc597c49a4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2024 16:35:52.7044 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Q9Ocy21G4TwlJNhKp+Ec/OEbA2YmSQL2vipVjo7sV4KaHTcq9bIDyzFfk50ZAgoJdUX9KW8QeJgtaQuR5fT+2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8638 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_093608_021585_40DC7382 X-CRM114-Status: GOOD ( 35.75 ) 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 Wed, Apr 10, 2024 at 04:45:47PM +0100, Will Deacon wrote: > On Wed, Apr 10, 2024 at 07:39:46AM +0000, Xu Yang wrote: > > > 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? > > > > For imx ddr pmu, most of the people will use metrics rather event itself, > > and we have speficy the format of event parameters in metrics table. > > The parameters is also updated in this patchset. > > > > And to easy use for user, the counter should be hidden (transparent) to > > user after I had talk with Frank. Then, the user need't to look up the event > > table to find which counter to use. > > > > So this patchset will basically not break the usage of perf tools and will > > improve practicality. > > Sorry, but I don't agree. The original commit adding this driver > (55691f99d417) gives the following examples in the commit message: > > For example: > perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_trans_filt,counter=2,axi_mask=ID_MASK,axi_id=ID/ > perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_wr_trans_filt,counter=3,axi_mask=ID_MASK,axi_id=ID/ > perf stat -a -I 1000 -e imx9_ddr0/eddrtq_pm_rd_beat_filt,counter=4,axi_mask=ID_MASK,axi_id=ID/ > > I don't think these will work any more if we apply this patch. Yang: keep compatible is important. Please try well's suggestion "if the driver just ignores whatever counter ID is provided in a backwards-compatible way)." If you have further question, you can ping directly. Please avoid use outlook to reply community email. It always append annoised "EXT". Frank > > Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel