]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: perf: Add support caps under sysfs
authorShaokun Zhang <zhangshaokun@hisilicon.com>
Tue, 22 Sep 2020 05:53:45 +0000 (13:53 +0800)
committerWill Deacon <will@kernel.org>
Mon, 28 Sep 2020 13:53:45 +0000 (14:53 +0100)
commit130329da73add8109c05135f40fe56567f3c9ebd
tree53bf50bc3ad0fba39c7084b4a295925ab7f9b1ca
parent121df23cc1599df760aaa0a2a416b7dfa141dd8a
arm64: perf: Add support caps under sysfs

ARMv8.4-PMU introduces the PMMIR_EL1 registers and some new PMU events,
like STALL_SLOT etc, are related to it. Let's add a caps directory to
/sys/bus/event_source/devices/armv8_pmuv3_0/ and support slots from
PMMIR_EL1 registers in this entry. The user programs can get the slots
from sysfs directly.

/sys/bus/event_source/devices/armv8_pmuv3_0/caps/slots is exposed
under sysfs. Both ARMv8.4-PMU and STALL_SLOT event are implemented,
it returns the slots from PMMIR_EL1, otherwise it will return 0.

Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/1600754025-53535-1-git-send-email-zhangshaokun@hisilicon.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/perf_event.h
arch/arm64/include/asm/sysreg.h
arch/arm64/kernel/perf_event.c
include/linux/perf/arm_pmu.h