From: Arnaldo Carvalho de Melo Date: Sat, 15 Jan 2022 20:15:09 +0000 (-0300) Subject: perf evlist: No need to do any affinity setup when profiling pids X-Git-Tag: v5.17-rc1~55^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2eea0b56b0d6ace0172550477220a25d633ec5b9;p=thirdparty%2Fkernel%2Flinux.git perf evlist: No need to do any affinity setup when profiling pids The cpumap is dummy, so no need to go on figuring out affinity.o This way we reduce the setup time for simple scenarios like: $ perf stat sleep 1 Acked-by: Andi Kleen Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 11eb95b2106b7..6e88d404b5b3e 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -1290,7 +1290,7 @@ void evlist__close(struct evlist *evlist) * With perf record core.cpus is usually NULL. * Use the old method to handle this for now. */ - if (!evlist->core.cpus) { + if (!evlist->core.cpus || cpu_map__is_dummy(evlist->core.cpus)) { evlist__for_each_entry_reverse(evlist, evsel) evsel__close(evsel); return;