[RFC V1 00/11] arm64/perf: Enable branch stack sampling

Anshuman Khandual anshuman.khandual at arm.com
Sun Jan 23 20:30:42 PST 2022


This series enables perf branch stack sampling support on arm64 platform
via a new arch feature called Branch Record Buffer Extension (BRBE). All
relevant register definitions could be accessed here.

https://developer.arm.com/documentation/ddi0601/2021-12/AArch64-Registers

The last two patches extend the perf ABI to accommodate additional branch
information that can be captured in BRBE. This series applies on v5.17-rc1.

Cc: Catalin Marinas <catalin.marinas at arm.com>
Cc: Will Deacon <will at kernel.org>
Cc: Mark Rutland <mark.rutland at arm.com>
Cc: Peter Zijlstra <peterz at infradead.org>
Cc: Ingo Molnar <mingo at redhat.com>
Cc: Arnaldo Carvalho de Melo <acme at kernel.org>
Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-perf-users at vger.kernel.org
Cc: linux-kernel at vger.kernel.org

Anshuman Khandual (11):
  perf: Consolidate branch sample filter helpers
  arm64/perf: Add register definitions for BRBE
  arm64/perf: Update struct arm_pmu for BRBE
  arm64/perf: Update struct pmu_hw_events for BRBE
  arm64/perf: Detect support for BRBE
  arm64/perf: Drive BRBE from perf event states
  arm64/perf: Add BRBE driver
  arm64/perf: Enable branch stack sampling
  perf: Add more generic branch types
  perf: Expand perf_branch_entry.type
  perf: Capture branch privilege information

 arch/arm64/include/asm/sysreg.h          | 216 ++++++++++++
 arch/arm64/kernel/perf_event.c           |  48 +++
 arch/x86/events/intel/lbr.c              |   4 +-
 drivers/perf/Kconfig                     |  11 +
 drivers/perf/Makefile                    |   1 +
 drivers/perf/arm_pmu.c                   |  65 +++-
 drivers/perf/arm_pmu_brbe.c              | 432 +++++++++++++++++++++++
 drivers/perf/arm_pmu_brbe.h              | 259 ++++++++++++++
 drivers/perf/arm_pmu_platform.c          |  34 ++
 include/linux/perf/arm_pmu.h             |  49 +++
 include/linux/perf_event.h               |  24 ++
 include/uapi/linux/perf_event.h          |  26 +-
 kernel/events/core.c                     |   9 +-
 tools/include/uapi/linux/perf_event.h    |  26 +-
 tools/perf/Documentation/perf-record.txt |   1 +
 tools/perf/util/branch.c                 |  13 +-
 tools/perf/util/parse-branch-options.c   |   1 +
 17 files changed, 1202 insertions(+), 17 deletions(-)
 create mode 100644 drivers/perf/arm_pmu_brbe.c
 create mode 100644 drivers/perf/arm_pmu_brbe.h

-- 
2.25.1




More information about the linux-arm-kernel mailing list