1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LIBPERF_INTERNAL_CPUMAP_H
3 #define __LIBPERF_INTERNAL_CPUMAP_H
5 #include <linux/refcount.h>
6 #include <perf/cpumap.h>
9 * A sized, reference counted, sorted array of integers representing CPU
10 * numbers. This is commonly used to capture which CPUs a PMU is associated
11 * with. The indices into the cpumap are frequently used as they avoid having
12 * gaps if CPU numbers were used. For events associated with a pid, rather than
13 * a CPU, a single dummy map with an entry of -1 is used.
17 /** Length of the map array. */
19 /** The CPU values. */
20 struct perf_cpu map[];
24 #define MAX_NR_CPUS 2048
27 int perf_cpu_map__idx(const struct perf_cpu_map *cpus, struct perf_cpu cpu);
28 bool perf_cpu_map__is_subset(const struct perf_cpu_map *a, const struct perf_cpu_map *b);
30 #endif /* __LIBPERF_INTERNAL_CPUMAP_H */