aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/auxtrace.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2022-05-06 15:25:42 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-05-10 14:23:34 -0300
commit024b3b42adc07f6292adcfbae50c6f2db0546b60 (patch)
tree1501dd8acbfbaaa4a4a59f4f97bc83a541d3a074 /tools/perf/util/auxtrace.c
parentperf evlist: Use libperf functions in evlist__enable_event_idx() (diff)
downloadlinux-dev-024b3b42adc07f6292adcfbae50c6f2db0546b60.tar.xz
linux-dev-024b3b42adc07f6292adcfbae50c6f2db0546b60.zip
perf auxtrace: Move evlist__enable_event_idx() to auxtrace.c
evlist__enable_event_idx() is used only by auxtrace. Move it to auxtrace.c in preparation for making it even more auxtrace specific. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Ian Rogers <irogers@google.com> Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Leo Yan <leo.yan@linaro.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lore.kernel.org/lkml/20220506122601.367589-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/auxtrace.c')
-rw-r--r--tools/perf/util/auxtrace.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c
index df1c5bbbaa0d..10936a38031f 100644
--- a/tools/perf/util/auxtrace.c
+++ b/tools/perf/util/auxtrace.c
@@ -636,6 +636,16 @@ int auxtrace_parse_snapshot_options(struct auxtrace_record *itr,
return -EINVAL;
}
+static int evlist__enable_event_idx(struct evlist *evlist, struct evsel *evsel, int idx)
+{
+ bool per_cpu_mmaps = !perf_cpu_map__empty(evlist->core.user_requested_cpus);
+
+ if (per_cpu_mmaps)
+ return perf_evsel__enable_cpu(&evsel->core, idx);
+
+ return perf_evsel__enable_thread(&evsel->core, idx);
+}
+
int auxtrace_record__read_finish(struct auxtrace_record *itr, int idx)
{
struct evsel *evsel;