libperf cpumap: Hide/reduce scope of MAX_NR_CPUS
authorIan Rogers <irogers@google.com>
Fri, 6 Dec 2024 04:40:30 +0000 (20:40 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 9 Dec 2024 20:52:41 +0000 (17:52 -0300)
Avoid redefinition of MAX_NR_CPUS as a global constant, the original
definition is tools/perf/perf.h.

Reviewed-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ben Gainey <ben.gainey@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Kyle Meyer <kyle.meyer@hpe.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20241206044035.1062032-4-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/lib/perf/cpumap.c
tools/lib/perf/include/internal/cpumap.h

index a36e90d381428b000c2a0d31c9b3658c8b65dd11..eb02acd96225923d7a1f59b7733394005aedd185 100644 (file)
@@ -12,6 +12,8 @@
 #include <limits.h>
 #include "internal.h"
 
+#define MAX_NR_CPUS 4096
+
 void perf_cpu_map__set_nr(struct perf_cpu_map *map, int nr_cpus)
 {
        RC_CHK_ACCESS(map)->nr = nr_cpus;
index 3cf28522004e9a091b3c2a0a6d2615c708ee8ef1..e2be2d17c32b5bb6544b34b0f4df7db6ed10682b 100644 (file)
@@ -21,10 +21,6 @@ DECLARE_RC_STRUCT(perf_cpu_map) {
        struct perf_cpu map[];
 };
 
-#ifndef MAX_NR_CPUS
-#define MAX_NR_CPUS    4096
-#endif
-
 struct perf_cpu_map *perf_cpu_map__alloc(int nr_cpus);
 int perf_cpu_map__idx(const struct perf_cpu_map *cpus, struct perf_cpu cpu);
 bool perf_cpu_map__is_subset(const struct perf_cpu_map *a, const struct perf_cpu_map *b);