Lines Matching defs:map
19 cpus->map[0] = -1;
26 static void cpu_map__delete(struct perf_cpu_map *map)
28 if (map) {
29 WARN_ONCE(refcount_read(&map->refcnt) != 0,
31 free(map);
35 struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map)
37 if (map)
38 refcount_inc(&map->refcnt);
39 return map;
42 void perf_cpu_map__put(struct perf_cpu_map *map)
44 if (map && refcount_dec_and_test(&map->refcnt))
45 cpu_map__delete(map);
62 cpus->map[i] = i;
83 memcpy(cpus->map, tmp_cpus, payload_size);
84 qsort(cpus->map, nr_cpus, sizeof(int), cmp_int);
88 if (i == 0 || cpus->map[i] != cpus->map[i - 1])
89 cpus->map[j++] = cpus->map[i];
251 return cpus->map[idx];
261 bool perf_cpu_map__empty(const struct perf_cpu_map *map)
263 return map ? map->map[0] == -1 : true;
271 if (cpus->map[i] == cpu)
278 int perf_cpu_map__max(struct perf_cpu_map *map)
282 for (i = 0; i < map->nr; i++) {
283 if (map->map[i] > max)
284 max = map->map[i];
293 * orig either gets freed and replaced with a new map, or reused
315 !memcmp(orig->map, other->map, orig->nr * sizeof(int)))
326 if (orig->map[i] <= other->map[j]) {
327 if (orig->map[i] == other->map[j])
329 tmp_cpus[k++] = orig->map[i++];
331 tmp_cpus[k++] = other->map[j++];
335 tmp_cpus[k++] = orig->map[i++];
338 tmp_cpus[k++] = other->map[j++];