From: Ian Rogers Date: Fri, 6 Dec 2024 04:40:30 +0000 (-0800) Subject: libperf cpumap: Hide/reduce scope of MAX_NR_CPUS X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=e8399d34d568d61cb57b0bc154b454676cd29dce;p=users%2Fdwmw2%2Flinux.git libperf cpumap: Hide/reduce scope of MAX_NR_CPUS Avoid redefinition of MAX_NR_CPUS as a global constant, the original definition is tools/perf/perf.h. Reviewed-by: Leo Yan Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ben Gainey Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Kyle Meyer Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20241206044035.1062032-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/lib/perf/cpumap.c b/tools/lib/perf/cpumap.c index a36e90d381428..eb02acd962259 100644 --- a/tools/lib/perf/cpumap.c +++ b/tools/lib/perf/cpumap.c @@ -12,6 +12,8 @@ #include #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; diff --git a/tools/lib/perf/include/internal/cpumap.h b/tools/lib/perf/include/internal/cpumap.h index 3cf28522004e9..e2be2d17c32b5 100644 --- a/tools/lib/perf/include/internal/cpumap.h +++ b/tools/lib/perf/include/internal/cpumap.h @@ -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);