summaryrefslogtreecommitdiff
path: root/tools/perf/lib/evlist.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2019-11-21 03:15:14 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-11-29 18:20:45 +0300
commita2408a70368ade9c99de27da78d49416313b8833 (patch)
treee34ab005c4f25808202ab03420b643faca142155 /tools/perf/lib/evlist.c
parent7074674e7338863e6404909c9761d4d3a610a379 (diff)
downloadlinux-a2408a70368ade9c99de27da78d49416313b8833.tar.xz
perf evlist: Maintain evlist->all_cpus
Maintain a cpumap in the evlist that is the union of all the cpus of the events. This needs a cpumap merge operation, which is added together with tests. v2: Add tests for cpu map merge Fix handling of duplicates Rename _update to _merge Factor out sorting. Fix handling of NULL maps in merge v3: Add comments and empty lines to _merge Committer testing: # perf test "Merge cpu map" 52: Merge cpu map : Ok # Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Link: http://lore.kernel.org/lkml/20191121001522.180827-5-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/lib/evlist.c')
-rw-r--r--tools/perf/lib/evlist.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c
index 205ddbb80bc1..ae9e65aa2491 100644
--- a/tools/perf/lib/evlist.c
+++ b/tools/perf/lib/evlist.c
@@ -54,6 +54,7 @@ static void __perf_evlist__propagate_maps(struct perf_evlist *evlist,
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);
}
static void perf_evlist__propagate_maps(struct perf_evlist *evlist)