Skip to content

Commit

Permalink
perf tools: Allow system-wide events to keep their own threads
Browse files Browse the repository at this point in the history
System-wide events do not have threads, so do not propagate threads to
them.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Link: https://lore.kernel.org/r/20220524075436.29144-16-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Adrian Hunter authored and Arnaldo Carvalho de Melo committed May 26, 2022
1 parent 298613b commit a41e24f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tools/lib/perf/evlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ static void __perf_evlist__propagate_maps(struct perf_evlist *evlist,
evsel->cpus = perf_cpu_map__get(evsel->own_cpus);
}

perf_thread_map__put(evsel->threads);
evsel->threads = perf_thread_map__get(evlist->threads);
if (!evsel->system_wide) {
perf_thread_map__put(evsel->threads);
evsel->threads = perf_thread_map__get(evlist->threads);
}

evlist->all_cpus = perf_cpu_map__merge(evlist->all_cpus, evsel->cpus);
}

Expand Down

0 comments on commit a41e24f

Please sign in to comment.