[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240806204813.722372-5-leo.yan@arm.com>
Date: Tue, 6 Aug 2024 21:48:12 +0100
From: Leo Yan <leo.yan@....com>
To: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
James Clark <james.clark@...aro.org>,
linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Leo Yan <leo.yan@....com>
Subject: [PATCH v3 4/5] perf auxtrace: Bails out after finding the event for the map index
After finding the corresponding event for the passed buffer index, it is
safe to say the found event has been used. Then, the tool can check the
event status and bails out if it has been disabled.
Signed-off-by: Leo Yan <leo.yan@....com>
---
tools/perf/util/auxtrace.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index 174d486056e0..7c998f95d2ff 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -688,15 +688,15 @@ int auxtrace_record__read_finish(struct auxtrace_record *itr, int idx)
int cpu_map_idx;
if (evsel__is_aux_event(evsel)) {
- if (evsel->disabled)
- return 0;
-
cpu_map_idx = evlist__find_cpu_map_idx(itr->evlist,
evsel, idx);
/* No map is found in per CPU mmap */
if (cpu_map_idx == -ENOENT)
return cpu_map_idx;
+ if (evsel->disabled)
+ return 0;
+
if (cpu_map_idx >= 0)
return evlist__enable_event_idx(evsel, 1, cpu_map_idx);
else
--
2.34.1
Powered by blists - more mailing lists