From nobody Fri Feb 13 10:59:29 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5B9FE80A92 for ; Wed, 27 Sep 2023 06:00:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229696AbjI0GAP (ORCPT ); Wed, 27 Sep 2023 02:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjI0GAI (ORCPT ); Wed, 27 Sep 2023 02:00:08 -0400 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF7192; Tue, 26 Sep 2023 23:00:05 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R601e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VszCdNB_1695794402; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VszCdNB_1695794402) by smtp.aliyun-inc.com; Wed, 27 Sep 2023 14:00:02 +0800 From: Jing Zhang To: John Garry , Ian Rogers Cc: Will Deacon , James Clark , Arnaldo Carvalho de Melo , Mark Rutland , Mike Leach , Leo Yan , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-doc@vger.kernel.org, Zhuo Song , Jing Zhang , Shuai Xue Subject: [PATCH v11 3/7] perf jevents: Support EventidCode and NodeType Date: Wed, 27 Sep 2023 13:59:47 +0800 Message-Id: <1695794391-34817-4-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1695794391-34817-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1695794391-34817-1-git-send-email-renyu.zj@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The previous code assumes an event has either an "event=3D" or "config" field at the beginning. For CMN neither of these may be present, as an event is typically "type=3Dxx,eventid=3Dxxx". So add EventidCode and NodeType to support CMN event description. I compared pmu_event.c before and after compiling with JEVENT_ARCH=3Dall, they are consistent. Signed-off-by: Jing Zhang Reviewed-by: Ian Rogers Tested-by: Ian Rogers --- tools/perf/pmu-events/jevents.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jeven= ts.py index af15fa2..f863aec 100755 --- a/tools/perf/pmu-events/jevents.py +++ b/tools/perf/pmu-events/jevents.py @@ -298,6 +298,7 @@ class JsonEvent: if 'ExtSel' in jd: eventcode |=3D int(jd['ExtSel']) << 8 configcode =3D int(jd['ConfigCode'], 0) if 'ConfigCode' in jd else None + eventidcode =3D int(jd['EventidCode'], 0) if 'EventidCode' in jd else = None self.name =3D jd['EventName'].lower() if 'EventName' in jd else None self.topic =3D '' self.compat =3D jd.get('Compat') @@ -335,7 +336,13 @@ class JsonEvent: if precise and self.desc and '(Precise Event)' not in self.desc: extra_desc +=3D ' (Must be precise)' if precise =3D=3D '2' else (' (= Precise ' 'event)') - event =3D f'config=3D{llx(configcode)}' if configcode is not None else= f'event=3D{llx(eventcode)}' + event =3D None + if configcode is not None: + event =3D f'config=3D{llx(configcode)}' + elif eventidcode is not None: + event =3D f'eventid=3D{llx(eventidcode)}' + else: + event =3D f'event=3D{llx(eventcode)}' event_fields =3D [ ('AnyThread', 'any=3D'), ('PortMask', 'ch_mask=3D'), @@ -345,6 +352,7 @@ class JsonEvent: ('Invert', 'inv=3D'), ('SampleAfterValue', 'period=3D'), ('UMask', 'umask=3D'), + ('NodeType', 'type=3D'), ] for key, value in event_fields: if key in jd and jd[key] !=3D '0': --=20 1.8.3.1