Lines Matching refs:cpus
21 static struct perf_cpu_map *cpu_map__from_entries(struct cpu_map_entries *cpus) in cpu_map__from_entries() argument
25 map = perf_cpu_map__empty_new(cpus->nr); in cpu_map__from_entries()
29 for (i = 0; i < cpus->nr; i++) { in cpu_map__from_entries()
35 if (cpus->cpu[i] == (u16) -1) in cpu_map__from_entries()
38 map->map[i] = (int) cpus->cpu[i]; in cpu_map__from_entries()
83 struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int) * nr); in perf_cpu_map__empty_new() local
85 if (cpus != NULL) { in perf_cpu_map__empty_new()
88 cpus->nr = nr; in perf_cpu_map__empty_new()
90 cpus->map[i] = -1; in perf_cpu_map__empty_new()
92 refcount_set(&cpus->refcnt, 1); in perf_cpu_map__empty_new()
95 return cpus; in perf_cpu_map__empty_new()
100 struct cpu_aggr_map *cpus = malloc(sizeof(*cpus) + sizeof(struct aggr_cpu_id) * nr); in cpu_aggr_map__empty_new() local
102 if (cpus != NULL) { in cpu_aggr_map__empty_new()
105 cpus->nr = nr; in cpu_aggr_map__empty_new()
107 cpus->map[i] = cpu_map__empty_aggr_cpu_id(); in cpu_aggr_map__empty_new()
109 refcount_set(&cpus->refcnt, 1); in cpu_aggr_map__empty_new()
112 return cpus; in cpu_aggr_map__empty_new()
163 int cpu_map__build_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **res, in cpu_map__build_map() argument
167 int nr = cpus->nr; in cpu_map__build_map()
179 s1 = f(cpus, cpu, data); in cpu_map__build_map()
278 int cpu_map__build_socket_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **sockp) in cpu_map__build_socket_map() argument
280 return cpu_map__build_map(cpus, sockp, cpu_map__get_socket, NULL); in cpu_map__build_socket_map()
283 int cpu_map__build_die_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **diep) in cpu_map__build_die_map() argument
285 return cpu_map__build_map(cpus, diep, cpu_map__get_die, NULL); in cpu_map__build_die_map()
288 int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **corep) in cpu_map__build_core_map() argument
290 return cpu_map__build_map(cpus, corep, cpu_map__get_core, NULL); in cpu_map__build_core_map()
293 int cpu_map__build_node_map(struct perf_cpu_map *cpus, struct cpu_aggr_map **numap) in cpu_map__build_node_map() argument
295 return cpu_map__build_map(cpus, numap, cpu_map__get_node, NULL); in cpu_map__build_node_map()
505 bool cpu_map__has(struct perf_cpu_map *cpus, int cpu) in cpu_map__has() argument
507 return perf_cpu_map__idx(cpus, cpu) != -1; in cpu_map__has()
510 int cpu_map__cpu(struct perf_cpu_map *cpus, int idx) in cpu_map__cpu() argument
512 return cpus->map[idx]; in cpu_map__cpu()