Lines Matching refs:cpus
15 struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int));
17 if (cpus != NULL) {
18 cpus->nr = 1;
19 cpus->map[0] = -1;
20 refcount_set(&cpus->refcnt, 1);
23 return cpus;
50 struct perf_cpu_map *cpus;
57 cpus = malloc(sizeof(*cpus) + nr_cpus * sizeof(int));
58 if (cpus != NULL) {
62 cpus->map[i] = i;
64 cpus->nr = nr_cpus;
65 refcount_set(&cpus->refcnt, 1);
68 return cpus;
79 struct perf_cpu_map *cpus = malloc(sizeof(*cpus) + payload_size);
82 if (cpus != NULL) {
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];
91 cpus->nr = j;
93 refcount_set(&cpus->refcnt, 1);
96 return cpus;
101 struct perf_cpu_map *cpus = NULL;
149 cpus = cpu_map__trim_new(nr_cpus, tmp_cpus);
151 cpus = cpu_map__default_new();
154 return cpus;
159 struct perf_cpu_map *cpus = NULL;
166 cpus = perf_cpu_map__read(onlnf);
168 return cpus;
173 struct perf_cpu_map *cpus = NULL;
237 cpus = cpu_map__trim_new(nr_cpus, tmp_cpus);
239 cpus = cpu_map__default_new();
241 cpus = perf_cpu_map__dummy_new();
245 return cpus;
248 int perf_cpu_map__cpu(const struct perf_cpu_map *cpus, int idx)
250 if (cpus && idx < cpus->nr)
251 return cpus->map[idx];
256 int perf_cpu_map__nr(const struct perf_cpu_map *cpus)
258 return cpus ? cpus->nr : 1;
266 int perf_cpu_map__idx(struct perf_cpu_map *cpus, int cpu)
270 for (i = 0; i < cpus->nr; ++i) {
271 if (cpus->map[i] == cpu)