[PATCH v1 0/6] perf auxtrace: Support multiple AUX events
From: Leo Yan <leo.yan@arm.com>
Date: 2024-07-21 20:21:36
Also in:
linux-perf-users, lkml
This series is to support multiple events with the *same* type in Perf AUX trace. As the first enabled instance, the patch series enables multiple Arm SPE events (e.g. arm_spe_0, arm_spe_1, etc) in AUX trace. The solution for support multiple AUX events with same type is not difficult. As the events are same type, the trace data shares the same format and can be decoded by the same decoder. Essentially, this patch series is to extend the AUX trace flow from support single PMU event to multiple events. Note, this series does not support a more complex case - different types of AUX events, (e.g. Arm CoreSight event and Arm SPE events are enabled simultaneously). Patch 01 is a minor refactoring for dereference PMU pointer from evsel structure. Patches 02, 03 and 04 are to use the 'auxtrace' flag for support multiple AUX events. Firstly, we need to set the 'auxtrace' flag for Arm and s390 AUX events (Intel PT and bts have set already it). Afterwards, by using the evsel__is_aux_event() function, the core layer iterates the whole evlist - which allows the buffer index can be matched to corresponding AUX event. Patches 05 and 06 are to configure multiple SPE event in architecture dependent code. The old code is only initialize the first AUX event. with this series, it initializes all SPE PMU events. This patch series has been tested with the normal 'perf record' command and 'perf mem record' command. And verified for the decoding commands 'perf script' and 'perf mem report'. I observed one prominent issue is for per-CPU profiling. For example, when specifying option '-C 2' for profiling on CPU2, in this case the 'arm_spe_0' event supports CPU2 but the 'arm_spe_1' event does not support the CPU. As a result, 'arm_spe_1' event reports failure. This is likely a common issue for support Per-CPU profiling with multiple PMU events and every PMU event only support partial CPUs. This issue will be addressed later. Leo Yan (6): perf pmu: Directly use evsel's PMU pointer perf auxtrace arm: Set the 'auxtrace' flag for AUX events perf auxtrace s390: Set the 'auxtrace' flag for AUX events perf auxtrace: Iterate all AUX events when finish reading perf arm-spe: Extract evsel setting up perf arm-spe: Support multiple Arm SPE events tools/perf/arch/arm/util/pmu.c | 3 + tools/perf/arch/arm64/util/arm-spe.c | 107 ++++++++++++++++----------- tools/perf/arch/s390/util/auxtrace.c | 1 + tools/perf/util/auxtrace.c | 15 +++- tools/perf/util/pmu.c | 2 +- 5 files changed, 78 insertions(+), 50 deletions(-) -- 2.34.1