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>
Showing
- tools/perf/lib/cpumap.c 57 additions, 0 deletionstools/perf/lib/cpumap.c
- tools/perf/lib/evlist.c 1 addition, 0 deletionstools/perf/lib/evlist.c
- tools/perf/lib/include/internal/evlist.h 1 addition, 0 deletionstools/perf/lib/include/internal/evlist.h
- tools/perf/lib/include/perf/cpumap.h 2 additions, 0 deletionstools/perf/lib/include/perf/cpumap.h
- tools/perf/tests/builtin-test.c 5 additions, 0 deletionstools/perf/tests/builtin-test.c
- tools/perf/tests/cpumap.c 16 additions, 0 deletionstools/perf/tests/cpumap.c
- tools/perf/tests/tests.h 1 addition, 0 deletionstools/perf/tests/tests.h
Please register or sign in to comment