linux/arch/powerpc/perf
Athira Rajeev 6320e693d9 powerpc/perf: Add support for caps under sysfs in powerpc
Add caps support under "/sys/bus/event_source/devices/<pmu>/"
for powerpc. This directory can be used to expose some of the
specific features that powerpc PMU supports to the user.
Example: pmu_name. The name of PMU registered will depend on
platform, say power9 or power10 or it could be Generic Compat
PMU.

Currently the only way to know which is the registered
PMU is from the dmesg logs. But clearing the dmesg will make it
difficult to know exact PMU backend used. And even extracting
from dmesg will be complicated, as we need  to parse the dmesg
logs and add filters for pmu name. Whereas by exposing it via
caps will make it easy as we just need to directly read it from
the sysfs.

Add a caps directory to /sys/bus/event_source/devices/cpu/
for power8, power9, power10 and generic compat PMU in respective
PMU driver code. Update the pmu_name file under caps folder
in core-book3s using "attr_update".

The information exposed currently:
 - pmu_name : Underlying PMU name from the driver

Example result with power9 pmu:

 # ls /sys/bus/event_source/devices/cpu/caps
pmu_name

 # cat /sys/bus/event_source/devices/cpu/caps/pmu_name
POWER9

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220520084630.15181-1-atrajeev@linux.vnet.ibm.com
2022-07-18 10:39:54 +10:00
..
req-gen
8xx-pmu.c powerpc: fix typos in comments 2022-05-05 22:12:44 +10:00
bhrb.S
callchain.c powerpc: make stack walking KASAN-safe 2021-06-17 00:09:11 +10:00
callchain.h powerpc/64s/hash: Make hash faults work in NMI context 2022-02-24 12:46:54 +11:00
callchain_32.c powerpc/vdso: Retrieve sigtramp offsets at buildtime 2020-12-04 01:01:17 +11:00
callchain_64.c powerpc/64s/hash: Make hash faults work in NMI context 2022-02-24 12:46:54 +11:00
core-book3s.c powerpc/perf: Add support for caps under sysfs in powerpc 2022-07-18 10:39:54 +10:00
core-fsl-emb.c powerpc/perf: move perf irq/nmi handling details into traps.c 2021-02-09 00:02:10 +11:00
e500-pmu.c
e6500-pmu.c
generic-compat-pmu.c powerpc/perf: Add support for caps under sysfs in powerpc 2022-07-18 10:39:54 +10:00
hv-24x7-catalog.h
hv-24x7-domains.h
hv-24x7.c powerpc/perf/24x7: use 'unsigned int' instead of 'unsigned' 2022-05-04 19:37:44 +10:00
hv-24x7.h
hv-common.c
hv-common.h
hv-gpci-requests.h
hv-gpci.c powerpc: declare unmodified attribute_group usages const 2022-03-08 22:15:32 +11:00
hv-gpci.h
imc-pmu.c powerpc: Add missing headers 2022-05-08 22:15:40 +10:00
internal.h powerpc/perf: Add __init attribute to eligible functions 2021-12-23 22:33:11 +11:00
isa207-common.c powerpc/perf: Update MMCR2 to support event exclude_idle 2022-06-29 19:42:41 +10:00
isa207-common.h powerpc/perf: Update MMCR2 to support event exclude_idle 2022-06-29 19:42:41 +10:00
Makefile powerpc/perf: Fix 32bit compile 2022-04-21 23:26:47 +10:00
mpc7450-pmu.c powerpc/perf: Adds support for programming of Thresholding in P10 2021-02-11 23:35:36 +11:00
perf_regs.c powerpc: Use the newly added is_tsk_32bit_task() macro 2022-02-12 22:47:42 +11:00
power5+-pmu.c powerpc/perf: Add __init attribute to eligible functions 2021-12-23 22:33:11 +11:00
power5-pmu.c powerpc/perf: Add __init attribute to eligible functions 2021-12-23 22:33:11 +11:00
power6-pmu.c powerpc/perf: Add __init attribute to eligible functions 2021-12-23 22:33:11 +11:00
power7-events-list.h
power7-pmu.c powerpc: declare unmodified attribute_group usages const 2022-03-08 22:15:32 +11:00
power8-events-list.h
power8-pmu.c powerpc/perf: Add support for caps under sysfs in powerpc 2022-07-18 10:39:54 +10:00
power9-events-list.h
power9-pmu.c powerpc/perf: Add support for caps under sysfs in powerpc 2022-07-18 10:39:54 +10:00
power10-events-list.h powerpc/perf: Fix cycles/instructions as PM_CYC/PM_INST_CMPL in power10 2021-10-14 21:46:45 +11:00
power10-pmu.c powerpc/perf: Add support for caps under sysfs in powerpc 2022-07-18 10:39:54 +10:00
ppc970-pmu.c powerpc/perf: Add __init attribute to eligible functions 2021-12-23 22:33:11 +11:00