Message ID | 20230919080929.3807123-1-xu.yang_2@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3209897vqi; Tue, 19 Sep 2023 01:07:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEew/sIRMdHMRqlKQHl3yRYHP3iYBoI63TowORbr2+pacDCtNTVRunMOPMSrCx8YkmWMMfm X-Received: by 2002:a05:6a20:8410:b0:153:591b:4101 with SMTP id c16-20020a056a20841000b00153591b4101mr14710875pzd.49.1695110877009; Tue, 19 Sep 2023 01:07:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695110876; cv=pass; d=google.com; s=arc-20160816; b=yzKOVOaEHRn3voH3nLTkHr0p0hJzjd3b/rUT0T1YqSI3hrALCVWEuLg1SohU8ad7UM qwVK4pyibEkHntlo9Wmw4OLzj7dUks4cx5sjMI4EIHEsRnnFuuM5tDXA4sSIVrSQrdx6 taviyUZytiMirU3Hlmd2N263exEhlbztSpmUTzO3a4uYVDr2KEqJ8vPuLMOKVE3ZwFqu SokH9yAqhypceE3Glwj0usRVIeslJtCbxdABfGXAwDysdj4E7IBwGvdtH6dW7OrlXWo9 aDQAI1nWmkHn3vZOK3AoQ1qMrkJD2T7zNzjjBZmOzrD41zhxC1gT+ZIsPpPDGdqb7D26 2gnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=FxhEgIgyV3L2F30HYyOnJZyO7eYfNR81TlxUv0LrLkg=; fh=dRsVOEBaW4VwVagXxvDBpi0CvUd1v1ux3siiqYRGD6g=; b=YtLwRSZjl1CZ1gXs8ypJBq1w/lD19nMpcIvnHnDE8UP+Y9RV775QOD+AeOJWCYMwbj 1KdiPzh+voYQoKP9a9IAA2N6TcPqbby3q6Rpb2eH/vYi4JauKBz1GVhB1zXy2XbRPhKq Rl4M/kZ7CsbJZIQ4T4p6pUfA6BsmuMayquZ6Ec2aJkn8XNUjew94Pnyt5oC6Z8gOQyNI vHmaBY0za4xu9F6o/MUxOKYOT6lZ6PkF3475HYUf9NAZtHmJf7Lugtq8Wzmni4g/f44L jnMlZ0RXnZXAbNlk5655DdZnHWlnAKPX1XMN4Yhsk8w2xhJU1sAHUbMcpGbyev4rI4XT ZHJQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=q6uliTaC; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id km8-20020a17090327c800b001bba8f79ad0si9151565plb.109.2023.09.19.01.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 01:07:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=q6uliTaC; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 823FB825ED94; Tue, 19 Sep 2023 01:05:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230306AbjISIFB (ORCPT <rfc822;toshivichauhan@gmail.com> + 26 others); Tue, 19 Sep 2023 04:05:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbjISIFA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 19 Sep 2023 04:05:00 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2047.outbound.protection.outlook.com [40.107.21.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49E98100; Tue, 19 Sep 2023 01:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TXIAj2gD+9/f2GBaawqEmiSWIsjrC+LbrL5gYOfWYhwHRUKN6nQ0ujjxGQzJh306jwTpdlCHlh38JQXAPDnw9GVGbLuRNd0fvt4qOiLm0DqsfVSIH9muprdmhPbEjMGJoJgpjDGEWr5nGyqdFUU2bIEDOfkBotRJiPSGikpTpYG7IYQUu2ErmY4Z/niZM+wNnuwTFRNvvudmAhQmm5SY0wQ0d3X0RePXMzRg2MKwjj3VcrNqi1P8NcXO4gXTUjJXUhYBwz9LE66XLa3CHAs+LYO9d5qWuLLTem+HQM07Lu0is5Iyh7F7Pk4/ZWpxRPMLtNko+hJUVetgQ8oj2slOTA== 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=FxhEgIgyV3L2F30HYyOnJZyO7eYfNR81TlxUv0LrLkg=; b=S/3Srgz9buyKgncvTVSfxifLVT4/fHu2AzyWXX5uZ0vFKnZcI939HuZny+sDu/7HpKLaMdnVkH0aJXTC7H6tcoDITEUGFMNjvj9YSEdmxF6awtKzLDZhAZtQ6FCZbglXBfCNoORCSXWFZLUPWBxqZRg4yLhtysCzd2gVxmpO+Bwdl6bMb90qlV9scYwLYzdCFN3hh+WJfYFxrkbrsJrADdbx3YhBUVjzJGTgyHsT+qasWib2o0zLECekHrhy/kOgcCQkzkDU+oDIIjYjZBMiwNPuDwgx7i6dqfIPaMWZimD8G+66CFReiysswSql3q+2ZHvXL6wTbA3l0RrsSGiBjQ== 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=FxhEgIgyV3L2F30HYyOnJZyO7eYfNR81TlxUv0LrLkg=; b=q6uliTaC6La/KIok26/PgXFlOaL/yIi3yh9HuyVI86NO+KC5VzlykcdyvzevpHcGnEJgeOdVTJz+ba4kKbcm2MR2mHnekx1FdFNUzrgcYtjaKMCilzgPd4xr4y5v0zEGh6q5HZISwxDKY3luioFrQHcOklT810WdzxLE3D0oIQE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB7PR04MB4505.eurprd04.prod.outlook.com (2603:10a6:5:39::26) by DU0PR04MB9394.eurprd04.prod.outlook.com (2603:10a6:10:359::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26; Tue, 19 Sep 2023 08:04:51 +0000 Received: from DB7PR04MB4505.eurprd04.prod.outlook.com ([fe80::6444:e07a:e7f7:3923]) by DB7PR04MB4505.eurprd04.prod.outlook.com ([fe80::6444:e07a:e7f7:3923%7]) with mapi id 15.20.6792.026; Tue, 19 Sep 2023 08:04:51 +0000 From: Xu Yang <xu.yang_2@nxp.com> To: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, irogers@google.com, adrian.hunter@intel.com Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, xu.yang_2@nxp.com Subject: [PATCH] perf jevents: fix no member named 'entries' issue Date: Tue, 19 Sep 2023 16:09:29 +0800 Message-Id: <20230919080929.3807123-1-xu.yang_2@nxp.com> X-Mailer: git-send-email 2.34.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR06CA0219.apcprd06.prod.outlook.com (2603:1096:4:68::27) To DB7PR04MB4505.eurprd04.prod.outlook.com (2603:10a6:5:39::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB7PR04MB4505:EE_|DU0PR04MB9394:EE_ X-MS-Office365-Filtering-Correlation-Id: a4943999-db5e-44b1-29f1-08dbb8e71989 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G8AF1GM5al4yxZEN8gDEU2MHbJd7xbv9eq+3DpFJrIsCbbsRP2aol16nv37QkusMdVZsySpZUw4vhOmO9A96Z9qvxWwM8XGLwGUCuj6hizuULklOPK0xUp4n134P4ccjv+vdOYynw1S6Gz9cGHJAooVUOLqem592o9wWYxhBt/xSVoCmLpfdzOiEf/gWvcF90++6pQyUAPPJe3bLhd0eZ++HOChSxrF0t5OdQ6pG03ev8GVkra3PUciIq2FrT122z5a5EopK9jH8D/LHdUzRNK0l+U9+YKJS1nl9qZv82Xw5Pjd+4sKA8Jg1Kay8+mtH6jLTUw3/mP50Djm44qAQpvz5+xRmEJuEvJZDkGp+V6Zj3Mt5ps5PtjUKIcqvIAGW80TNJj0Re/zDIwYZqSiSAMJV3656SS/+iWCsLsGZc67Pvhhf3P9+Mf41WkJBcXjR6qauGxRm/HvT2NUnA2Qh7ikE1ITfTDywL2WOb3KtP1N7VjdjpKdectycpH9O727DAh+P2kJhNwQGPTCtqhqrRSpJm2Rst+MN8wARam+hhKl78TFIRblPFQTHUa5luHs2nALGpDnkpF3KKvtg5QFJpUCdTtyZT/csDoo7pBbrxKkl9WCI/84H/T5DU4zT5VfB X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR04MB4505.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(376002)(396003)(366004)(346002)(451199024)(186009)(1800799009)(6666004)(6486002)(52116002)(36756003)(6506007)(86362001)(38350700002)(38100700002)(2616005)(1076003)(26005)(2906002)(6512007)(478600001)(8676002)(83380400001)(5660300002)(4326008)(8936002)(41300700001)(66556008)(7416002)(66946007)(66476007)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?HkHjGYo0BeEF4AmNpofKB+0oRC+l?= =?utf-8?q?5pz274TCcQ1wYeDBQrjjnHBb8NS+GmnY2j9K5wRtkWhE+FzajZXh9cn+P0s2FtZHU?= =?utf-8?q?jkJbeC6zTQSIyHP3pNYGPm70CqUGaq7IrIMkeL9FcUl8tx/9AHm3WNWA6aKg3YOpS?= =?utf-8?q?IcU6Yy3jTzctb1F6YWriGWO792YYMlaWWJNic7WSsIRX7IEF+hQvFvG2IZlEGZT15?= =?utf-8?q?dF8Zw8ZkBRWE3mDNeazV9tApk9HOHyYktdT5+Xv7KndeFpKW/AFpieoi1Nx1tH3kG?= =?utf-8?q?okdJqRd+Evb14i4aw4uM4AJW6eEjMyl5zBDoPruVyyZOrfn5biZBRVXkDUcnH3n+a?= =?utf-8?q?RBOir1jAnet+VlFzMpqVUcph1ITL4l106tX5RlgbyuDBz/W4f8HjVeETcXup4fp26?= =?utf-8?q?DgLo+5xS4oKQcDLaaLcmmk/WAgVN0SRwQKeqUabpVZBnS0Krwzqre8WuXVZtPllZm?= =?utf-8?q?upo05i0m8wp9Pj6+oE/hEZxUNf01XpdhGGHQwoWFcDOxt7XUwDyLpTZEolUfypMeS?= =?utf-8?q?ukJ9njK5zqCBhv6JQJuRYOGrtoppVd+Kw+08W7TTA5iZorSip3nutsEmTtFxy3x30?= =?utf-8?q?JqiCKplIZVC1OG6w8ub2lDE2NAUagZZHfGe+wF32AmhcdxFaB8/uVB/8hhA/5Jw0k?= =?utf-8?q?ZNbiB5rvkLDSo7z2me8bQEcZrcM3xQd58eFWC6fGPZWM2hAxW9fW/p/sCA6Z/Vuru?= =?utf-8?q?phsO7Y3fxf734vSxyNe8ELsjsKf/ljlCLrp5grzv/gZZMao4jfQocqTWcOZvUuoES?= =?utf-8?q?I0nPlR29ULpTpDEE0M3snhFAaYkNbMYIu1khtRn0NltKrHbyiAfcn/ypI+25luwl7?= =?utf-8?q?2ObQDt4+2nVN+dldP6Wr5s6wFXm5cTsvjx5cK/fgfJJBKA4ZKIqczJwd1Gf42eqlM?= =?utf-8?q?fNB5b107dWMlNZwCEzmqaiAF1DCtTDrmrw5SpUGpTJu3y0QCfEyWS9hPzqNvY4ahB?= =?utf-8?q?IWOLMEM8MAVhT0EFz7Ni6sspusTAu4UAOL7yVtv5pR0+WY62g9fr0j8K0dqqPk0Rq?= =?utf-8?q?NKPyH2fIL6iu92IMC4/BxaOgvbQngIXDpMKPear+CEzb7gjeW57pipfis0339PnSH?= =?utf-8?q?7Das7g8pEqOdp2GKRhvUsJAC9pIWEkHqNXcDAKNGMYoe/IbtNGl3pxnjkpxymyqMx?= =?utf-8?q?CDyHUqzdV/DV3faaV6SUI1W6mYmHUF8KWG17/AOi6/ru5WW73Fl357mB1RYNSg7S0?= =?utf-8?q?15Du/hUmo7eAR8g6wN90p90RIEiFHWKp2HzqM9F8CDGDVkiTSBbX9MGNbt2Z4UGRI?= =?utf-8?q?3reXngJGQAme+BbVxXfnFGigw7P8qFSaY6dnTk7va5JKTT/zuVV3tbdWJUNW0cEdW?= =?utf-8?q?2UlwOOXPJ12WD6A902wkKgmUYqOVLc6Kzfp8UU16CF6z8udbCdZOfqKvWO4xVuyD8?= =?utf-8?q?Oe2VcpGkJw1XUbWavViHVZy0ohQt/+uXN1GFkztDZJO2M8SgQI98OPSWceOHfMJ3q?= =?utf-8?q?8gw3IPCRj7LYcRGZ2hMqcWxLK98IgXII0EMdsgO3qc4X0gURC3CkmCmBgdxoHiNMW?= =?utf-8?q?C4TZtWUnwNIE?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a4943999-db5e-44b1-29f1-08dbb8e71989 X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB4505.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2023 08:04:51.1255 (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: PGUr0efceQJ7txdF5stWsQFRoyNVelMPZvhhSxibXcAgppP9/WztNe70S0I0uNl6Z4hmxE+hYXWCjlTdj2MwlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9394 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 01:05:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777452582863813763 X-GMAIL-MSGID: 1777452582863813763 |
Series |
perf jevents: fix no member named 'entries' issue
|
|
Commit Message
Xu Yang
Sept. 19, 2023, 8:09 a.m. UTC
The struct "pmu_events_table" has been changed after commit
2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23).
So there doesn't exist 'entries' in pmu_events_table anymore.
This will align the members with that commit. Othewise, below
errors will be printed when run jevent.py:
pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’
5485 | .entries = pmu_metrics__freescale_imx8dxl_sys,
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
---
tools/perf/pmu-events/jevents.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
On Tue, Sep 19, 2023 at 1:04 AM Xu Yang <xu.yang_2@nxp.com> wrote: > > The struct "pmu_events_table" has been changed after commit > 2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23). > So there doesn't exist 'entries' in pmu_events_table anymore. > This will align the members with that commit. Othewise, below > errors will be printed when run jevent.py: > > pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’ > 5485 | .entries = pmu_metrics__freescale_imx8dxl_sys, > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com> Reviewed-by: Ian Rogers <irogers@google.com> Thanks Xu! I wasn't able to repeat the failure but the fix looks good to me. Is the failure caused by adding new imx8dxl metrics? I'd like to make sure we have testing coverage so this doesn't happen again. I'm trying: $ make -C tools/perf O=/tmp/perf JEVENTS_ARCH=all Could you confirm that this make command was broken without your fix plus the metric changes you've done? Thanks, Ian > --- > tools/perf/pmu-events/jevents.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py > index a7e88332276d..af15fa2cadbd 100755 > --- a/tools/perf/pmu-events/jevents.py > +++ b/tools/perf/pmu-events/jevents.py > @@ -764,8 +764,8 @@ static const struct pmu_sys_events pmu_sys_event_tables[] = { > continue > _args.output_file.write(f"""\t{{ > \t\t.metric_table = {{ > -\t\t\t.entries = {tblname}, > -\t\t\t.length = ARRAY_SIZE({tblname}) > +\t\t\t.pmus = {tblname}, > +\t\t\t.num_pmus = ARRAY_SIZE({tblname}) > \t\t}}, > \t\t.name = \"{tblname}\", > \t}}, > -- > 2.34.1 >
Hi Lan, > On Tue, Sep 19, 2023 at 1:04 AM Xu Yang <xu.yang_2@nxp.com> wrote: > > > > The struct "pmu_events_table" has been changed after commit > > 2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23). > > So there doesn't exist 'entries' in pmu_events_table anymore. > > This will align the members with that commit. Othewise, below > > errors will be printed when run jevent.py: > > > > pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’ > > 5485 | .entries = pmu_metrics__freescale_imx8dxl_sys, > > > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com> > > Reviewed-by: Ian Rogers <irogers@google.com> > > Thanks Xu! I wasn't able to repeat the failure but the fix looks good > to me. Is the failure caused by adding new imx8dxl metrics? I'd like Yes. > to make sure we have testing coverage so this doesn't happen again. > I'm trying: > $ make -C tools/perf O=/tmp/perf JEVENTS_ARCH=all > Could you confirm that this make command was broken without your fix > plus the metric changes you've done? Below steps will repeat the failure. $ cd tools/ $ rm perf/pmu-events/arch/arm64/freescale/imx8mm/sys/ddrc.json $ make clean $ make JEVENTS_ARCH=all perf pmu-events/pmu-events.c:76586:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’ 76586 | .entries = pmu_metrics__freescale_imx8mm_sys, | ^~~~~~~ pmu-events/pmu-events.c:76587:26: error: ‘struct pmu_metrics_table’ has no member named ‘length’ 76587 | .length = ARRAY_SIZE(pmu_metrics__freescale_imx8mm_sys) | ^~~~~~ If only metric table exists, then this error may occur. Thanks, Xu Yang
Hello, On Tue, Sep 19, 2023 at 7:07 PM Xu Yang <xu.yang_2@nxp.com> wrote: > > Hi Lan, > > > On Tue, Sep 19, 2023 at 1:04 AM Xu Yang <xu.yang_2@nxp.com> wrote: > > > > > > The struct "pmu_events_table" has been changed after commit > > > 2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23). > > > So there doesn't exist 'entries' in pmu_events_table anymore. > > > This will align the members with that commit. Othewise, below > > > errors will be printed when run jevent.py: > > > > > > pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’ > > > 5485 | .entries = pmu_metrics__freescale_imx8dxl_sys, > > > > > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com> > > > > Reviewed-by: Ian Rogers <irogers@google.com> > > > > Thanks Xu! I wasn't able to repeat the failure but the fix looks good > > to me. Is the failure caused by adding new imx8dxl metrics? I'd like > > Yes. > > > to make sure we have testing coverage so this doesn't happen again. > > I'm trying: > > $ make -C tools/perf O=/tmp/perf JEVENTS_ARCH=all > > Could you confirm that this make command was broken without your fix > > plus the metric changes you've done? > > Below steps will repeat the failure. > > $ cd tools/ > $ rm perf/pmu-events/arch/arm64/freescale/imx8mm/sys/ddrc.json > $ make clean > $ make JEVENTS_ARCH=all perf > > pmu-events/pmu-events.c:76586:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’ > 76586 | .entries = pmu_metrics__freescale_imx8mm_sys, > | ^~~~~~~ > pmu-events/pmu-events.c:76587:26: error: ‘struct pmu_metrics_table’ has no member named ‘length’ > 76587 | .length = ARRAY_SIZE(pmu_metrics__freescale_imx8mm_sys) > | ^~~~~~ > > If only metric table exists, then this error may occur. I can reproduce the error and confirm it fixed. Tested-by: Namhyung Kim <namhyung@kernel.org> Thanks, Namhyung
On Tue, Sep 19, 2023 at 9:16 PM Namhyung Kim <namhyung@kernel.org> wrote: > > Hello, > > On Tue, Sep 19, 2023 at 7:07 PM Xu Yang <xu.yang_2@nxp.com> wrote: > > > > Hi Lan, > > > > > On Tue, Sep 19, 2023 at 1:04 AM Xu Yang <xu.yang_2@nxp.com> wrote: > > > > > > > > The struct "pmu_events_table" has been changed after commit > > > > 2e255b4f9f41 (perf jevents: Group events by PMU, 2023-08-23). > > > > So there doesn't exist 'entries' in pmu_events_table anymore. > > > > This will align the members with that commit. Othewise, below > > > > errors will be printed when run jevent.py: > > > > > > > > pmu-events/pmu-events.c:5485:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’ > > > > 5485 | .entries = pmu_metrics__freescale_imx8dxl_sys, > > > > > > > > Signed-off-by: Xu Yang <xu.yang_2@nxp.com> > > > > > > Reviewed-by: Ian Rogers <irogers@google.com> > > > > > > Thanks Xu! I wasn't able to repeat the failure but the fix looks good > > > to me. Is the failure caused by adding new imx8dxl metrics? I'd like > > > > Yes. > > > > > to make sure we have testing coverage so this doesn't happen again. > > > I'm trying: > > > $ make -C tools/perf O=/tmp/perf JEVENTS_ARCH=all > > > Could you confirm that this make command was broken without your fix > > > plus the metric changes you've done? > > > > Below steps will repeat the failure. > > > > $ cd tools/ > > $ rm perf/pmu-events/arch/arm64/freescale/imx8mm/sys/ddrc.json > > $ make clean > > $ make JEVENTS_ARCH=all perf > > > > pmu-events/pmu-events.c:76586:26: error: ‘struct pmu_metrics_table’ has no member named ‘entries’ > > 76586 | .entries = pmu_metrics__freescale_imx8mm_sys, > > | ^~~~~~~ > > pmu-events/pmu-events.c:76587:26: error: ‘struct pmu_metrics_table’ has no member named ‘length’ > > 76587 | .length = ARRAY_SIZE(pmu_metrics__freescale_imx8mm_sys) > > | ^~~~~~ > > > > If only metric table exists, then this error may occur. > > I can reproduce the error and confirm it fixed. > > Tested-by: Namhyung Kim <namhyung@kernel.org> Applied to perf-tools-next, thanks!
diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py index a7e88332276d..af15fa2cadbd 100755 --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -764,8 +764,8 @@ static const struct pmu_sys_events pmu_sys_event_tables[] = { continue _args.output_file.write(f"""\t{{ \t\t.metric_table = {{ -\t\t\t.entries = {tblname}, -\t\t\t.length = ARRAY_SIZE({tblname}) +\t\t\t.pmus = {tblname}, +\t\t\t.num_pmus = ARRAY_SIZE({tblname}) \t\t}}, \t\t.name = \"{tblname}\", \t}},