mei: do not overwrite state on hw start
[linux-2.6-microblaze.git] / tools / lib / perf / include / perf / cpumap.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LIBPERF_CPUMAP_H
3 #define __LIBPERF_CPUMAP_H
4
5 #include <perf/core.h>
6 #include <perf/cpumap.h>
7 #include <stdio.h>
8 #include <stdbool.h>
9
10 LIBPERF_API struct perf_cpu_map *perf_cpu_map__dummy_new(void);
11 LIBPERF_API struct perf_cpu_map *perf_cpu_map__default_new(void);
12 LIBPERF_API struct perf_cpu_map *perf_cpu_map__new(const char *cpu_list);
13 LIBPERF_API struct perf_cpu_map *perf_cpu_map__read(FILE *file);
14 LIBPERF_API struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map);
15 LIBPERF_API struct perf_cpu_map *perf_cpu_map__merge(struct perf_cpu_map *orig,
16                                                      struct perf_cpu_map *other);
17 LIBPERF_API void perf_cpu_map__put(struct perf_cpu_map *map);
18 LIBPERF_API struct perf_cpu perf_cpu_map__cpu(const struct perf_cpu_map *cpus, int idx);
19 LIBPERF_API int perf_cpu_map__nr(const struct perf_cpu_map *cpus);
20 LIBPERF_API bool perf_cpu_map__empty(const struct perf_cpu_map *map);
21 LIBPERF_API struct perf_cpu perf_cpu_map__max(struct perf_cpu_map *map);
22 LIBPERF_API bool perf_cpu_map__has(const struct perf_cpu_map *map, struct perf_cpu cpu);
23
24 #define perf_cpu_map__for_each_cpu(cpu, idx, cpus)              \
25         for ((idx) = 0, (cpu) = perf_cpu_map__cpu(cpus, idx);   \
26              (idx) < perf_cpu_map__nr(cpus);                    \
27              (idx)++, (cpu) = perf_cpu_map__cpu(cpus, idx))
28
29 #endif /* __LIBPERF_CPUMAP_H */