From: Leo Yan Date: Tue, 6 Aug 2024 20:41:22 +0000 (+0100) Subject: perf auxtrace: Use evsel__is_aux_event() for checking AUX event X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c87826ddcefaf0b1245d1d8c61040679ea0bd387;p=users%2Fwilly%2Fxarray.git perf auxtrace: Use evsel__is_aux_event() for checking AUX event Use evsel__is_aux_event() to decide if an event is a AUX event, this is a refactoring to replace comparing the PMU type. Reviewed-by: Adrian Hunter Signed-off-by: Leo Yan Cc: Ian Rogers Cc: James Clark Cc: Kan Liang Cc: Mike Leach Cc: Namhyung Kim Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20240806204130.720977-2-leo.yan@arm.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index cbb773ed6f1a..ca8682966fae 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -671,11 +671,11 @@ int auxtrace_record__read_finish(struct auxtrace_record *itr, int idx) { struct evsel *evsel; - if (!itr->evlist || !itr->pmu) + if (!itr->evlist) return -EINVAL; evlist__for_each_entry(itr->evlist, evsel) { - if (evsel->core.attr.type == itr->pmu->type) { + if (evsel__is_aux_event(evsel)) { if (evsel->disabled) return 0; return evlist__enable_event_idx(itr->evlist, evsel, idx);