]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/perf: Expose Performance Monitor Counter SPR's as part of extended regs
authorAthira Rajeev <atrajeev@linux.vnet.ibm.com>
Wed, 3 Feb 2021 06:55:36 +0000 (01:55 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 8 Feb 2021 14:09:44 +0000 (01:09 +1100)
commite79b76e03b712e42c58d9649c92571e346abc38b
tree4e324cfb63a0ca6a880fa0360f575d93946ca2b7
parent91f3469a43fd1fb831649c2a2e684bf5ad4818b2
powerpc/perf: Expose Performance Monitor Counter SPR's as part of extended regs

Currently Monitor Mode Control Registers and Sampling registers are
part of extended regs. Patch adds support to include Performance Monitor
Counter Registers (PMC1 to PMC6 ) as part of extended registers.

PMCs are saved in the perf interrupt handler as part of
per-cpu array 'pmcs' in struct cpu_hw_events. While capturing
the register values for extended regs, fetch these saved PMC values.

Simplified the PERF_REG_PMU_MASK_300/31 definition to include PMU
SPRs MMCR0 to PMC6. Exclude the unsupported SPRs (MMCR3, SIER2, SIER3)
from extended mask value for CPU_FTR_ARCH_300 in the new definition.

PERF_REG_EXTENDED_MAX is used to check if any index beyond the extended
registers is requested in the sample. Have one PERF_REG_EXTENDED_MAX
for CPU_FTR_ARCH_300/CPU_FTR_ARCH_31 since perf_reg_validate function
already checks the extended mask for the presence of any unsupported
register.

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/1612335337-1888-3-git-send-email-atrajeev@linux.vnet.ibm.com
arch/powerpc/include/asm/perf_event.h
arch/powerpc/include/uapi/asm/perf_regs.h
arch/powerpc/perf/core-book3s.c
arch/powerpc/perf/perf_regs.c