[RFC V1 00/11] arm64/perf: Enable branch stack sampling
From: Anshuman Khandual
Date: Sun Jan 23 2022 - 23:31:32 EST
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@xxxxxxx>
Cc: Will Deacon <will@xxxxxxxxxx>
Cc: Mark Rutland <mark.rutland@xxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
Cc: linux-perf-users@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
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