OSDN Git Service
simpleperf: Support event_source bus event types
The perf_event subsystem exports available PMUs and their events under
/sys/bus/event_source/devices directory. This patch supports those
events using 'pmu/event/' format like in the mainline perf tool.
The "event" part above might have multiple terms if supported by PMU.
In that case PMU would have "format" directory for available terms.
They would be seperated by comma, so the enclosing "/"s are needed to
group those terms for an event.
But currently all PMUs seem to support a single term only so I left
the parser to split events by comma and match the whole string
(including "/"s).
For example you can use cpu-cycles events like below:
# simpleperf stat -a -e armv8_pmuv3/cpu_cycles/ sleep 1
Performance counter statistics:
986,481,766 armv8_pmuv3/cpu_cycles/ # (100%)
Total test time: 1.007272 seconds.
Test: build and run simpleperf_unit_test
Change-Id: Ibdf1180e58d190f8108cdc8d8a096e6323b2a6f3