All of lore.kernel.org
 help / color / mirror / Atom feed
* PMU event repository for Arm
@ 2021-12-10 15:52 Al Grant
  2021-12-10 18:47 ` Ian Rogers
  0 siblings, 1 reply; 4+ messages in thread
From: Al Grant @ 2021-12-10 15:52 UTC (permalink / raw)
  To: linux-perf-users

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PMU event repository for Arm
  2021-12-10 15:52 PMU event repository for Arm Al Grant
@ 2021-12-10 18:47 ` Ian Rogers
  2021-12-14 10:22   ` James Clark
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Rogers @ 2021-12-10 18:47 UTC (permalink / raw)
  To: Al Grant; +Cc: linux-perf-users

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

On Fri, Dec 10, 2021 at 7:53 AM Al Grant <al.grant@foss.arm.com> wrote:
>
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PMU event repository for Arm
  2021-12-10 18:47 ` Ian Rogers
@ 2021-12-14 10:22   ` James Clark
  2021-12-14 18:26     ` Ian Rogers
  0 siblings, 1 reply; 4+ messages in thread
From: James Clark @ 2021-12-14 10:22 UTC (permalink / raw)
  To: Ian Rogers, Al Grant, Andrew Kilroy; +Cc: linux-perf-users



On 10/12/2021 18:47, Ian Rogers wrote:
> 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

> 
> Thanks,
> Ian
> 
> On Fri, Dec 10, 2021 at 7:53 AM Al Grant <al.grant@foss.arm.com> wrote:
>>
>> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PMU event repository for Arm
  2021-12-14 10:22   ` James Clark
@ 2021-12-14 18:26     ` Ian Rogers
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Rogers @ 2021-12-14 18:26 UTC (permalink / raw)
  To: James Clark; +Cc: Al Grant, Andrew Kilroy, linux-perf-users

On Tue, Dec 14, 2021 at 2:23 AM James Clark <james.clark@arm.com> wrote:
>
>
>
> On 10/12/2021 18:47, Ian Rogers wrote:
> > 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

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/20201110100346.2527031-1-irogers@google.com/

> >
> > Thanks,
> > Ian
> >
> > On Fri, Dec 10, 2021 at 7:53 AM Al Grant <al.grant@foss.arm.com> wrote:
> >>
> >> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-14 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-10 15:52 PMU event repository for Arm Al Grant
2021-12-10 18:47 ` Ian Rogers
2021-12-14 10:22   ` James Clark
2021-12-14 18:26     ` Ian Rogers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.