Skip to content

perf: Expand captured branch types

Anshuman Khandual linux-arm-kernel linux-perf-users lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2perf: Add more generic branch typesarch/x86/events/intel/lbr.c include/uapi/linux/perf_event.h tools/include/uapi/linux/perf_event.h +1 more+18 -34 replies
2/2perf: Expand perf_branch_entry.typeinclude/uapi/linux/perf_event.h tools/include/uapi/linux/perf_event.h tools/perf/util/branch.c +1 more+25 -75 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/2] perf: Expand captured branch types

Branch Record Buffer Extension (BRBE) implementation on arm64 captures more branch type classification which cannot be accommodated in the current perf branch record format via perf_branch_entry.type element. To overcome this limitation, perf_branch_entry.type needs to be expanded along with generic branch classification.

This series achieves this expansion. But before that it adds more generic branch classification types which can be accommodated without any changes, while also updating the x86 implementation as required.

This series applies on v5.17-rc1

Please find BRBE captured branch type classification reference here.

https://developer.arm.com/documentation/ddi0601/2021-12/AArch64-Registers/
BRBINF-n--EL1--Branch-Record-Buffer-Information-Register--n-?lang=en

Proposed perf branch stack enablement on arm64 platform can be found here.

https://lore.kernel.org/all/[email protected]/

These patches are split from the above series (PATCH 9/11, PATCH 10/11) as these perf changes are pre-requisite for BRBE enablement. Although there is another proposal (PATCH 11/11), extending struct perf_branch_entry further to capture branch record privilege level information (priv, 2 bits), it is not included here. But please do let me know if that proposal should also be discussed in this series. Thank you.

Cc Peter Zijlstra <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Arnaldo Carvalho de Melo <[email protected]>
Cc Mark Rutland <[email protected]>

Anshuman Khandual (2):
perf: Add more generic branch types
perf: Expand perf_branch_entry.type

 arch/x86/events/intel/lbr.c           |  4 ++--
 include/uapi/linux/perf_event.h       | 15 +++++++++++++--
 tools/include/uapi/linux/perf_event.h | 15 +++++++++++++--
 tools/perf/util/branch.c              | 13 ++++++++++++-
 tools/perf/util/branch.h              |  4 ++--
 5 files changed, 42 insertions(+), 9 deletions(-)
Signature · 1 line
2.25.1