Skip to content

RFC perf/core: extend perf_reg and perf_sample_regs_intr

Madhavan Srinivasan linux-arm-kernel linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3perf/core: extend perf_regs to include arch specific regsarch/arm/include/asm/ptrace.h arch/arm/kernel/perf_regs.c arch/arm64/include/asm/ptrace.h +7 more+26 -90 replies
2/3perf/powerpc: update macros and add regs to arch_misc_reg structarch/powerpc/include/uapi/asm/perf_regs.h arch/powerpc/include/uapi/asm/ptrace.h arch/powerpc/perf/perf_regs.c +1 more+61 -40 replies
3/3perf/powerpc: Functions to update arch_misc_regsarch/powerpc/perf/core-book3s.c kernel/events/core.c+30 -10 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/3]perf/core: extend perf_reg and perf_sample_regs_intr

This patchset extend the perf sample regs infrastructure to include architecture specific regs. Current perf_sample_regs_intr exports only registers in the pt_regs to perf.data using PERF_SAMPLE_REGS_INTR sample type. But sometimes we end up looking for or prefer raw register values at the interrupt during debug.

This patchset extends the perf_regs to include arch specific struct, and makes perf_sample_regs_intr in kernel/event/core.c as __weak__ function. This way, an arch specific implementation of perf_sample_regs_intr() can update the arch specific data to the perf_regs.

First patch defines a new structure arch_misc_reg and updates the same in the struct perf_regs. Patch also modifies the perf_reg_value() and perf_output_sample_regs() to take perf_regs parameter instead of pt_regs.

Second patch updates struct arch_misc_reg for arch/powerpc with pmu registers and adds offsetof macro for the same. It extends perf_reg_value() to use reg idx to decide on struct to return value from.

Third patch adds arch specific perf_sample_regs_intr() in arch/powerpc to hook up the arch_misc_regs to perf_regs.

This patchset depends on the recent posting by Anju T in linuxppc-dev at lists.ozlabs.org to enable PERF_SAMPLE_REGS_INTR support in arch/powerpc.

https://patchwork.ozlabs.org/patch/539242/
https://patchwork.ozlabs.org/patch/539243/
https://patchwork.ozlabs.org/patch/539244/

Would appreciate comments and feedback.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Stephane Eranian <[email protected]>
Cc Russell King <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Sukadev Bhattiprolu <[email protected]>

Madhavan Srinivasan (3):
perf/core: extend perf_regs to include arch specific regs perf/powerpc: update macros and add regs to arch_misc_reg struct perf/powerpc: Functions to update arch_misc_regs

 arch/arm/include/asm/ptrace.h               |  2 ++
 arch/arm/kernel/perf_regs.c                 |  4 +++-
 arch/arm64/include/asm/ptrace.h             |  2 ++
 arch/arm64/kernel/perf_regs.c               |  4 +++-
 arch/powerpc/include/uapi/asm/perf_regs.h   | 10 ++++++++++
 arch/powerpc/include/uapi/asm/ptrace.h      | 11 +++++++++++
 arch/powerpc/perf/core-book3s.c             | 29 +++++++++++++++++++++++++++++
 arch/powerpc/perf/perf_regs.c               | 28 ++++++++++++++++++++++++++--
 arch/x86/include/asm/ptrace.h               |  2 ++
 arch/x86/kernel/perf_regs.c                 |  4 +++-
 include/linux/perf_regs.h                   |  5 +++--
 kernel/events/core.c                        |  8 ++++----
 tools/perf/arch/powerpc/include/perf_regs.h | 16 ++++++++++++++++
 13 files changed, 114 insertions(+), 11 deletions(-)

--
1.9.1