Lines Matching +full:cpu +full:- +full:map

1 /* SPDX-License-Identifier: GPL-2.0 */
9 /** A wrapper around a CPU to avoid confusion with the perf_cpu_map's map's indices. */
11 int16_t cpu; member
22 * perf_cpu_map__new_any_cpu - a map with a singular "any CPU"/dummy -1 value.
26 * perf_cpu_map__new_online_cpus - a map read from
27 * /sys/devices/system/cpu/online if
28 * available. If reading wasn't possible a map
35 * perf_cpu_map__new - create a map from the given cpu_list such as "0-7". If no
40 LIBPERF_API struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map);
45 LIBPERF_API void perf_cpu_map__put(struct perf_cpu_map *map);
47 * perf_cpu_map__cpu - get the CPU value at the given index. Returns -1 if index
52 * perf_cpu_map__nr - for an empty map returns 1, as perf_cpu_map__cpu returns a
53 * cpu of -1 for an invalid index, this makes an empty map
54 * look like it contains the "any CPU"/dummy value. Otherwise
55 * the result is the number CPUs in the map plus one if the
56 * "any CPU"/dummy value is present.
60 * perf_cpu_map__has_any_cpu_or_is_empty - is map either empty or has the "any CPU"/dummy value.
62 LIBPERF_API bool perf_cpu_map__has_any_cpu_or_is_empty(const struct perf_cpu_map *map);
64 * perf_cpu_map__is_any_cpu_or_is_empty - is map either empty or the "any CPU"/dummy value.
66 LIBPERF_API bool perf_cpu_map__is_any_cpu_or_is_empty(const struct perf_cpu_map *map);
68 * perf_cpu_map__is_empty - does the map contain no values and it doesn't
69 * contain the special "any CPU"/dummy value.
71 LIBPERF_API bool perf_cpu_map__is_empty(const struct perf_cpu_map *map);
73 * perf_cpu_map__min - the minimum CPU value or -1 if empty or just the "any CPU"/dummy value.
75 LIBPERF_API struct perf_cpu perf_cpu_map__min(const struct perf_cpu_map *map);
77 * perf_cpu_map__max - the maximum CPU value or -1 if empty or just the "any CPU"/dummy value.
79 LIBPERF_API struct perf_cpu perf_cpu_map__max(const struct perf_cpu_map *map);
80 LIBPERF_API bool perf_cpu_map__has(const struct perf_cpu_map *map, struct perf_cpu cpu);
84 * perf_cpu_map__any_cpu - Does the map contain the "any CPU"/dummy -1 value?
86 LIBPERF_API bool perf_cpu_map__has_any_cpu(const struct perf_cpu_map *map);
88 #define perf_cpu_map__for_each_cpu(cpu, idx, cpus) \ argument
89 for ((idx) = 0, (cpu) = perf_cpu_map__cpu(cpus, idx); \
91 (idx)++, (cpu) = perf_cpu_map__cpu(cpus, idx))
97 if ((_cpu).cpu != -1)