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

perf tools: Get rid of evlist__add_on_all_cpus()

The cpu and thread maps are properly handled in libperf now. No need to
do it in the perf tools anymore. Let's remove the logic.

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221003204647.1481128-4-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
60ea006f 7e2450bb

+2 -27
+2 -27
tools/perf/util/evlist.c
··· 268 268 return 0; 269 269 } 270 270 271 - static void evlist__add_on_all_cpus(struct evlist *evlist, struct evsel *evsel) 272 - { 273 - evsel->core.system_wide = true; 274 - 275 - /* 276 - * All CPUs. 277 - * 278 - * Note perf_event_open() does not accept CPUs that are not online, so 279 - * in fact this CPU list will include only all online CPUs. 280 - */ 281 - perf_cpu_map__put(evsel->core.own_cpus); 282 - evsel->core.own_cpus = perf_cpu_map__new(NULL); 283 - perf_cpu_map__put(evsel->core.cpus); 284 - evsel->core.cpus = perf_cpu_map__get(evsel->core.own_cpus); 285 - 286 - /* No threads */ 287 - perf_thread_map__put(evsel->core.threads); 288 - evsel->core.threads = perf_thread_map__new_dummy(); 289 - 290 - evlist__add(evlist, evsel); 291 - } 292 - 293 271 struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide) 294 272 { 295 273 struct evsel *evsel = evlist__dummy_event(evlist); ··· 280 302 evsel->core.attr.exclude_hv = 1; 281 303 evsel->core.attr.freq = 0; 282 304 evsel->core.attr.sample_period = 1; 305 + evsel->core.system_wide = system_wide; 283 306 evsel->no_aux_samples = true; 284 307 evsel->name = strdup("dummy:u"); 285 308 286 - if (system_wide) 287 - evlist__add_on_all_cpus(evlist, evsel); 288 - else 289 - evlist__add(evlist, evsel); 290 - 309 + evlist__add(evlist, evsel); 291 310 return evsel; 292 311 } 293 312