[PATCH v4 7/8] perf auxtrace: Iterate all AUX events when finish reading
Leo Yan
leo.yan at arm.com
Fri Aug 9 05:14:46 PDT 2024
When finished to read AUX trace data from mmaped buffer, based on the
AUX buffer index the core layer needs to search the corresponding PMU
event and re-enable it to continue tracing.
However, current code only searches the first AUX event. It misses to
search other enabled AUX events, thus, it returns failure if the buffer
index does not belong to the first AUX event.
This patch changes to continue searching every enabled AUX events for
covering the mmaped buffer indexes.
Signed-off-by: Leo Yan <leo.yan at arm.com>
---
tools/perf/util/auxtrace.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index ac6e2e428a66..9056bc7bcfce 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -690,9 +690,13 @@ int auxtrace_record__read_finish(struct auxtrace_record *itr, int idx)
cpu_map_idx = evlist__find_cpu_map_idx(itr->evlist,
evsel, idx);
- /* No map is found in per CPU mmap */
+ /*
+ * No map is found in per CPU mmap. Multiple AUX events
+ * might be opened in a session, continue to check if
+ * the next AUX event can cover the mmaped buffer 'idx'.
+ */
if (cpu_map_idx == -ENOENT)
- return cpu_map_idx;
+ continue;
if (evsel->disabled)
return 0;
--
2.34.1
More information about the linux-arm-kernel
mailing list