pmu-events is the gold mine that contains all the information perf has about all the events it knows from every architecture it supports.
The way it works is that it has a set of JSON files describing all events. A python script then generates one huge C file from these JSON files which a bunch of helpers which can be used to retrieve event information based on architecture and CPU model.
With this we get
named counter support for A64FX, Sapphire Rapids and many more architectures.
access to the formulas that are used to calculate synthetic events such as the topdown events.
we can throw away that table in platform.cpp
A quick and dirty hack shows that the amount of functions that we have to rip out of the kernel to make it standalone is relatively small. Atleast for x86 (there is some architecture dependent stuff in it) I've managed to get it to work very fast.
pmu-events is the gold mine that contains all the information perf has about all the events it knows from every architecture it supports.
The way it works is that it has a set of JSON files describing all events. A python script then generates one huge C file from these JSON files which a bunch of helpers which can be used to retrieve event information based on architecture and CPU model.
With this we get
A quick and dirty hack shows that the amount of functions that we have to rip out of the kernel to make it standalone is relatively small. Atleast for x86 (there is some architecture dependent stuff in it) I've managed to get it to work very fast.