[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241107125308.41226-1-leo.yan@arm.com>
Date: Thu, 7 Nov 2024 12:53:05 +0000
From: Leo Yan <leo.yan@....com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Ian Rogers <irogers@...gle.com>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
James Clark <james.clark@...aro.org>,
linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Leo Yan <leo.yan@....com>
Subject: [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(-)
--
2.34.1
Powered by blists - more mailing lists