Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
024b3b42 a40bb751

+10 -12
+10
tools/perf/util/auxtrace.c
··· 636 636 return -EINVAL; 637 637 } 638 638 639 + static int evlist__enable_event_idx(struct evlist *evlist, struct evsel *evsel, int idx) 640 + { 641 + bool per_cpu_mmaps = !perf_cpu_map__empty(evlist->core.user_requested_cpus); 642 + 643 + if (per_cpu_mmaps) 644 + return perf_evsel__enable_cpu(&evsel->core, idx); 645 + 646 + return perf_evsel__enable_thread(&evsel->core, idx); 647 + } 648 + 639 649 int auxtrace_record__read_finish(struct auxtrace_record *itr, int idx) 640 650 { 641 651 struct evsel *evsel;
-10
tools/perf/util/evlist.c
··· 538 538 (evlist->enabled ? evlist__disable : evlist__enable)(evlist); 539 539 } 540 540 541 - int evlist__enable_event_idx(struct evlist *evlist, struct evsel *evsel, int idx) 542 - { 543 - bool per_cpu_mmaps = !perf_cpu_map__empty(evlist->core.user_requested_cpus); 544 - 545 - if (per_cpu_mmaps) 546 - return perf_evsel__enable_cpu(&evsel->core, idx); 547 - 548 - return perf_evsel__enable_thread(&evsel->core, idx); 549 - } 550 - 551 541 int evlist__add_pollfd(struct evlist *evlist, int fd) 552 542 { 553 543 return perf_evlist__add_pollfd(&evlist->core, fd, NULL, POLLIN, fdarray_flag__default);
-2
tools/perf/util/evlist.h
··· 196 196 void evlist__disable_evsel(struct evlist *evlist, char *evsel_name); 197 197 void evlist__enable_evsel(struct evlist *evlist, char *evsel_name); 198 198 199 - int evlist__enable_event_idx(struct evlist *evlist, struct evsel *evsel, int idx); 200 - 201 199 void evlist__set_selected(struct evlist *evlist, struct evsel *evsel); 202 200 203 201 int evlist__create_maps(struct evlist *evlist, struct target *target);