[PATCH v3 1/5] perf/core: Allow multiple AUX PMU events with the same module
From: Leo Yan
Date: Tue Aug 06 2024 - 16:48:51 EST
This commit changes the condition from checking the same PMU instance to
checking the same PMU driver module. This allows support for multiple
PMU events with the same driver module.
As a result, more than one AUX event (e.g. arm_spe_0 and arm_spe_1) can
record trace into the AUX ring buffer.
Signed-off-by: Leo Yan <leo.yan@xxxxxxx>
---
kernel/events/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index aa3450bdc227..fdb8918e62a0 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -12344,9 +12344,10 @@ perf_event_set_output(struct perf_event *event, struct perf_event *output_event)
/*
* If both events generate aux data, they must be on the same PMU
+ * module but can be with different PMU instances.
*/
if (has_aux(event) && has_aux(output_event) &&
- event->pmu != output_event->pmu)
+ event->pmu->module != output_event->pmu->module)
goto out;
/*
--
2.34.1