powerpc/perf: Export Power8 generic and cache events to sysfs
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Mon, 11 Jan 2016 22:55:26 +0000 (14:55 -0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 10 Mar 2016 11:56:05 +0000 (22:56 +1100)
commite0728b50d480da6be228dd160a43b37e4c0b1636
tree7cbe66270a412a5a8b886685d48294580029aef3
parentd4969e2459c6e852a6862256cf8e869aaa3e8adf
powerpc/perf: Export Power8 generic and cache events to sysfs

Power8 supports a large number of events in each susbystem so when a
user runs:

perf stat -e branch-instructions sleep 1
perf stat -e L1-dcache-loads sleep 1

it is not clear as to which PMU events were monitored.

Export the generic hardware and cache perf events for Power8 to sysfs,
so users can precisely determine the PMU event monitored by the generic
event.

Eg:
cat /sys/bus/event_source/devices/cpu/events/branch-instructions
event=0x10068

$ cat /sys/bus/event_source/devices/cpu/events/L1-dcache-loads
event=0x100ee

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/perf_event_server.h
arch/powerpc/perf/power8-events-list.h [new file with mode: 0644]
arch/powerpc/perf/power8-pmu.c