Skip to content

Return EINVAL when precise_ip perf events are requested on Arm

James Clark linux-arm-kernel lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1Return EINVAL when precise_ip perf events are requested on Armdrivers/perf/arm_pmu.c include/uapi/linux/perf_event.h+5 -27 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] Return EINVAL when precise_ip perf events are requested on Arm

Hi,

Since we're adding support for SPE in user space Perf, we've encountered an issue where we would like some more feedback if SPE isn't available for an event.

At the moment there is a patch for perf where you can enable SPE by doing this:

perf record -r branch-misses:p ...

Perf will have a hard coded list of events that can use SPE when ":p" is specified and open the SPE PMU instead of the specified one. But if the event isn't in that list, then Perf will attempt to open the normal event with precise_ip = 1. That will succeed at the moment, but we'd like the kernel to say it's not supported so there is a chance of showing a warning to the user.

This isn't just relevant to Perf though, there may be other tools that are already setting this.

Therefore I'm looking for feedback on whether this would break backwards compatibility with user space tools that are already setting precise_ip and expecting it to not error out on Arm.

This change would also be beneficial for the case where if in the (distant) future we do add some kind of precise support, there will be a chance of userspace determining what is supported and what isn't.

Thanks
James

Cc Will Deacon <[email protected]>
Cc Mark Rutland <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Tan Xiaojun <[email protected]>
Cc Al Grant <[email protected]>
Cc Namhyung Kim <[email protected]>

James Clark (1):
Return EINVAL when precise_ip perf events are requested on Arm

 drivers/perf/arm_pmu.c          | 3 +++
 include/uapi/linux/perf_event.h | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.24.0