Skip to content

Commit 8b1ae32

Browse files
committed
libperf cpumap: Hide/reduce scope of MAX_NR_CPUS
JIRA: https://issues.redhat.com/browse/RHEL-73893 upstream ======== commit e8399d3 Author: Ian Rogers <irogers@google.com> Date: Thu Dec 5 20:40:30 2024 -0800 description =========== 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> Signed-off-by: Michael Petlan <mpetlan@redhat.com>
1 parent 891d2ee commit 8b1ae32

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

tools/lib/perf/cpumap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <limits.h>
1212
#include "internal.h"
1313

14+
#define MAX_NR_CPUS 4096
15+
1416
void perf_cpu_map__set_nr(struct perf_cpu_map *map, int nr_cpus)
1517
{
1618
RC_CHK_ACCESS(map)->nr = nr_cpus;

tools/lib/perf/include/internal/cpumap.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ DECLARE_RC_STRUCT(perf_cpu_map) {
2121
struct perf_cpu map[];
2222
};
2323

24-
#ifndef MAX_NR_CPUS
25-
#define MAX_NR_CPUS 4096
26-
#endif
27-
2824
struct perf_cpu_map *perf_cpu_map__alloc(int nr_cpus);
2925
int perf_cpu_map__idx(const struct perf_cpu_map *cpus, struct perf_cpu cpu);
3026
bool perf_cpu_map__is_subset(const struct perf_cpu_map *a, const struct perf_cpu_map *b);

0 commit comments

Comments
 (0)