[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1695037955-107983-4-git-send-email-renyu.zj@linux.alibaba.com>
Date: Mon, 18 Sep 2023 19:52:31 +0800
From: Jing Zhang <renyu.zj@...ux.alibaba.com>
To: John Garry <john.g.garry@...cle.com>,
Ian Rogers <irogers@...gle.com>
Cc: Will Deacon <will@...nel.org>, James Clark <james.clark@....com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Mike Leach <mike.leach@...aro.org>,
Leo Yan <leo.yan@...aro.org>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-perf-users@...r.kernel.org, linux-doc@...r.kernel.org,
Zhuo Song <zhuo.song@...ux.alibaba.com>,
Jing Zhang <renyu.zj@...ux.alibaba.com>,
Shuai Xue <xueshuai@...ux.alibaba.com>
Subject: [PATCH v9 3/7] perf jevents: Support EventidCode and NodeType
The previous code assumes an event has either an "event=" or "config"
field at the beginning. For CMN neither of these may be present, as an
event is typically "type=xx,eventid=xxx".
So add EventidCode and NodeType to support CMN event description.
I compared pmu_event.c before and after compiling with JEVENT_ARCH=all,
they are consistent.
Signed-off-by: Jing Zhang <renyu.zj@...ux.alibaba.com>
---
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/jevents.py
index a7e8833..057d51aa 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 |= int(jd['ExtSel']) << 8
configcode = int(jd['ConfigCode'], 0) if 'ConfigCode' in jd else None
+ eventidcode = int(jd['EventidCode'], 0) if 'EventidCode' in jd else None
self.name = jd['EventName'].lower() if 'EventName' in jd else None
self.topic = ''
self.compat = jd.get('Compat')
@@ -335,7 +336,13 @@ class JsonEvent:
if precise and self.desc and '(Precise Event)' not in self.desc:
extra_desc += ' (Must be precise)' if precise == '2' else (' (Precise '
'event)')
- event = f'config={llx(configcode)}' if configcode is not None else f'event={llx(eventcode)}'
+ event = None
+ if configcode is not None:
+ event = f'config={llx(configcode)}'
+ elif eventidcode is not None:
+ event = f'eventid={llx(eventidcode)}'
+ else:
+ event = f'event={llx(eventcode)}'
event_fields = [
('AnyThread', 'any='),
('PortMask', 'ch_mask='),
@@ -345,6 +352,7 @@ class JsonEvent:
('Invert', 'inv='),
('SampleAfterValue', 'period='),
('UMask', 'umask='),
+ ('NodeType', 'type='),
]
for key, value in event_fields:
if key in jd and jd[key] != '0':
--
1.8.3.1
Powered by blists - more mailing lists