Skip to content

perf cpumap: Refactor perf_cpu_map__merge()

Leo Yan linux-perf-users lkml 1 version Applied

Status from this message: Thanks, applied the series.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 4 repliesApplied

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3libperf cpumap: Refactor perf_cpu_map__merge()tools/lib/perf/cpumap.c tools/lib/perf/evlist.c tools/lib/perf/include/perf/cpumap.h +2 more+40 -331 reply
2/3perf cpumap: Add more tests for CPU map mergingtools/perf/tests/cpumap.c+29 -51 reply
3/3perf cpumap: Add checking for reference countertools/perf/tests/cpumap.c+9 -02 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchAdrian Hunter
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] perf cpumap: Refactor perf_cpu_map__merge()

perf_cpu_map__merge() has two arguments, 'orig' and 'other'. The function definition might cause confusion as it could give the impression that the CPU maps in the two arguments are copied into a new allocated structure, which is then returned as the result.

This patch series refactors perf_cpu_map__merge(), makes that the first argument 'orig' as a pointer to pointer, the merged result will be updated into 'orig' rather than returning a pointer. This can be clear for the semantics that it merges 'other' into 'orig'.

The perf test has been updated for covering more cases for CPU map merging. Tested result is:

  # ./perf test 41
   41: CPU map                            :
   41.1: Synthesize cpu map               : Ok
   41.2: Print cpu map                    : Ok
   41.3: Merge cpu map                    : Ok
   41.4: Intersect cpu map                : Ok
   41.5: Equal cpu map                    : Ok

Leo Yan (3):
libperf cpumap: Refactor perf_cpu_map__merge()
perf cpumap: Add more tests for CPU map merging
perf cpumap: Add checking for reference counter

 tools/lib/perf/cpumap.c              | 49 +++++++++++++------------
 tools/lib/perf/evlist.c              |  2 +-
 tools/lib/perf/include/perf/cpumap.h |  4 +--
 tools/perf/tests/cpumap.c            | 54 ++++++++++++++++++++++------
 tools/perf/util/mem-events.c         |  5 ++-
 5 files changed, 77 insertions(+), 37 deletions(-)
Signature · 1 line
2.34.1