Lines Matching defs:map
13 void perf_cpu_map__set_nr(struct perf_cpu_map *map, int nr_cpus)
15 RC_CHK_ACCESS(map)->nr = nr_cpus;
35 RC_CHK_ACCESS(cpus)->map[0].cpu = -1;
40 static void cpu_map__delete(struct perf_cpu_map *map)
42 if (map) {
43 WARN_ONCE(refcount_read(perf_cpu_map__refcnt(map)) != 0,
45 RC_CHK_FREE(map);
49 struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map)
53 if (RC_CHK_GET(result, map))
54 refcount_inc(perf_cpu_map__refcnt(map));
59 void perf_cpu_map__put(struct perf_cpu_map *map)
61 if (map) {
62 if (refcount_dec_and_test(perf_cpu_map__refcnt(map)))
63 cpu_map__delete(map);
65 RC_CHK_PUT(map);
83 RC_CHK_ACCESS(cpus)->map[i].cpu = i;
104 return RC_CHK_ACCESS(cpus)->map[idx];
114 memcpy(RC_CHK_ACCESS(cpus)->map, tmp_cpus, payload_size);
115 qsort(RC_CHK_ACCESS(cpus)->map, nr_cpus, sizeof(struct perf_cpu), cmp_cpu);
122 RC_CHK_ACCESS(cpus)->map[j++].cpu =
303 bool perf_cpu_map__empty(const struct perf_cpu_map *map)
305 return map ? __perf_cpu_map__cpu(map, 0).cpu == -1 : true;
359 bool perf_cpu_map__has_any_cpu(const struct perf_cpu_map *map)
361 return map && __perf_cpu_map__cpu(map, 0).cpu == -1;
364 struct perf_cpu perf_cpu_map__max(const struct perf_cpu_map *map)
371 return __perf_cpu_map__nr(map) > 0
372 ? __perf_cpu_map__cpu(map, __perf_cpu_map__nr(map) - 1)
399 * orig either gets freed and replaced with a new map, or reused