PMU event repository for Arm
Hi, other vendors have shown the value of having a machine-readable collection of PMU events, and we now have this for Arm:
https://github.com/ARM-software/data
This is equivalent to the tables in about 40 of Arm's public CPU reference manuals. It includes some details that aren't needed in tools/perf/pmu-events, but one could be generated from the other.
There's also a map of CPU ids (MIDR) to CPU names, and an example script to scan /proc/cpuinfo and retrieve the correct JSON file(s).
I won't spam linux-perf-users every time we add something, but we haven't publicized this before, so here it is. Feedback is welcome.
Al
This is very helpful! It is a bit strange seeing the event codes not as hex. Do you have any plans around metrics? What is the flow from this json to the linux/tools/perf json?
Thanks,
Ian
Quoted 17 lines · Al Grant
Hi, other vendors have shown the value of having a machine-readable collection of PMU events, and we now have this for Arm:
https://github.com/ARM-software/data
This is equivalent to the tables in about 40 of Arm's public CPU reference manuals. It includes some details that aren't needed in
tools/perf/pmu-events, but one could be generated from the other.There's also a map of CPU ids (MIDR) to CPU names, and an example script to scan
/proc/cpuinfoand retrieve the correct JSON file(s).I won't spam linux-perf-users every time we add something, but we haven't publicized this before, so here it is. Feedback is welcome.
Al
Quoted 3 lines · Ian Rogers
This is very helpful! It is a bit strange seeing the event codes not as hex. Do you have any plans around metrics? What is the flow from this json to the linux/tools/perf json?
Hi Ian,
I can't answer about the metrics part, but we do currently have an internal script to convert from this repo to the perf tools jsons. Maybe @Andrew can clarify what the plan to upstream this is. I think we struggled to find a suitable place to put it.
James
Quoted 22 lines
Thanks,
IanQuoted 17 lines · Al Grant
Hi, other vendors have shown the value of having a machine-readable collection of PMU events, and we now have this for Arm:
https://github.com/ARM-software/data
This is equivalent to the tables in about 40 of Arm's public CPU reference manuals. It includes some details that aren't needed in
tools/perf/pmu-events, but one could be generated from the other.There's also a map of CPU ids (MIDR) to CPU names, and an example script to scan
/proc/cpuinfoand retrieve the correct JSON file(s).I won't spam linux-perf-users every time we add something, but we haven't publicized this before, so here it is. Feedback is welcome.
Al
Quoted 8 lines · James Clark
Quoted 3 lines · Ian Rogers
This is very helpful! It is a bit strange seeing the event codes not as hex. Do you have any plans around metrics? What is the flow from this json to the linux/tools/perf json?
Quoted 8 lines
Hi Ian,
I can't answer about the metrics part, but we do currently have an internal script to convert from this repo to the perf tools jsons. Maybe @Andrew can clarify what the plan to upstream this is. I think we struggled to find a suitable place to put it.
James
Github? :-) Fwiw, there are some similar scripts [1,2].
It is somewhat laborious getting the latest event data built into perf for some architectures - download json/csv from one website, get scripts from github, convert, insert into the perf json folder. A problem is that perf versions of some the event/metric data is becoming stale compared to what can be generated. It is best if this data is sent by vendors, but I also understand that it can be hard for teams at vendors to test the updates. If we do find something is broken then what do we update? The original json, the converter script, or the json in the Linux tree. If we don't change the code/json in the Linux tree, how do we get the fix in?
Perhaps others have thoughts? It seems possible to host scripts in Linux that will do the laborious steps above, to enable building perf with the best event data with the minimum of heroics. Such a build could be used by those doing packaging. This does somewhat beg the question as to why we have the perf format json in the tree? There's also a degree of code sharing that could be done between converter scripts and the jevents code. We have collections of metrics, including for ARM, that it would be interesting to get into the Linux tree. We generate the perf json for those metrics using other tools like [3] that we've tried to contribute as part of the jevents code in the past.
Thanks,
Ian
[1] https://github.com/intel/event-converter-for-linux-perf
[2] https://github.com/intel/perfmon-metrics
[3] https://lore.kernel.org/lkml/[email protected]/
Quoted 22 lines
Quoted 22 lines
Thanks,
IanQuoted 17 lines · Al Grant
Hi, other vendors have shown the value of having a machine-readable collection of PMU events, and we now have this for Arm:
https://github.com/ARM-software/data
This is equivalent to the tables in about 40 of Arm's public CPU reference manuals. It includes some details that aren't needed in
tools/perf/pmu-events, but one could be generated from the other.There's also a map of CPU ids (MIDR) to CPU names, and an example script to scan
/proc/cpuinfoand retrieve the correct JSON file(s).I won't spam linux-perf-users every time we add something, but we haven't publicized this before, so here it is. Feedback is welcome.
Al