]> www.infradead.org Git - users/jedix/linux-maple.git/commit
libperf cpumap: Refactor perf_cpu_map__merge()
authorLeo Yan <leo.yan@arm.com>
Thu, 7 Nov 2024 12:53:06 +0000 (12:53 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 9 Dec 2024 20:52:41 +0000 (17:52 -0300)
commita9d2217556f7745e082b765ed44ad5c0172aa5a1
tree47864caeaf7563752c128859f05017e6fc61d6c3
parent161c3402fd9918af6254cb3ef68a0d119df544cd
libperf cpumap: Refactor perf_cpu_map__merge()

The perf_cpu_map__merge() function 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.

The purpose of the function is to merge the CPU map 'other' into the CPU
map 'orig'.  This commit changes the 'orig' argument to a pointer to
pointer, so the new result will be updated into 'orig'.

The return value is changed to an int type, as an error number or 0 for
success.

Update callers and tests for the new function definition.

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20241107125308.41226-2-leo.yan@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/perf/cpumap.c
tools/lib/perf/evlist.c
tools/lib/perf/include/perf/cpumap.h
tools/perf/tests/cpumap.c
tools/perf/util/mem-events.c