[PATCH v6] arm64: perf: Add support caps in sysfs

Will Deacon will at kernel.org
Mon Sep 7 06:30:55 EDT 2020

On Thu, Jul 23, 2020 at 07:56:52PM +0800, Shaokun Zhang wrote:
> 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
> through sysfs. Both ARMv8.4-PMU and STALL_SLOT event are implemented,
> it returns the slots from PMMIR_EL1, otherwise it will return an empty
> string.

Returning an empty string seems a little hostile for parsing code here.
Wouldn't we be better off either returning 0 or not exposing the file at
all in the case that the feature is not supported?


More information about the linux-arm-kernel mailing list