File libperf-add-perf_cpu_map__get-perf_cpu_map__put.patch of Package perf
xxxxxxxxxx
1
From: Jiri Olsa <jolsa@kernel.org>
2
Date: Sun, 21 Jul 2019 13:24:17 +0200
3
Subject: libperf: Add perf_cpu_map__get()/perf_cpu_map__put()
4
Git-commit: 38f01d8da1d8d28678ea16a0a484f4d3eded34b2
5
Patch-mainline: v5.4-rc1
6
References: jsc#SLE-13661
7
8
Moving the following functions:
9
10
cpu_map__get()
11
cpu_map__put()
12
13
to libperf with following names:
14
15
perf_cpu_map__get()
16
perf_cpu_map__put()
17
18
Committer notes:
19
20
Added fixes for arm/arm64
21
22
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
23
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
24
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
25
Cc: Andi Kleen <ak@linux.intel.com>
26
Cc: Michael Petlan <mpetlan@redhat.com>
27
Cc: Namhyung Kim <namhyung@kernel.org>
28
Cc: Peter Zijlstra <peterz@infradead.org>
29
Link: http://lkml.kernel.org/r/20190721112506.12306-31-jolsa@kernel.org
30
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
31
Signed-off-by: Tony Jones <tonyj@suse.de>
32
---
33
tools/perf/arch/arm/util/cs-etm.c | 6 +++---
34
tools/perf/arch/arm64/util/header.c | 4 ++--
35
tools/perf/builtin-ftrace.c | 2 +-
36
tools/perf/builtin-stat.c | 4 ++--
37
tools/perf/lib/cpumap.c | 24 ++++++++++++++++++++++++
38
tools/perf/lib/include/perf/cpumap.h | 2 ++
39
tools/perf/lib/libperf.map | 2 ++
40
tools/perf/tests/bitmap.c | 2 +-
41
tools/perf/tests/code-reading.c | 4 ++--
42
tools/perf/tests/cpumap.c | 8 ++++----
43
tools/perf/tests/event-times.c | 4 ++--
44
tools/perf/tests/event_update.c | 4 ++--
45
tools/perf/tests/keep-tracking.c | 2 +-
46
tools/perf/tests/mem2node.c | 2 +-
47
tools/perf/tests/mmap-basic.c | 2 +-
48
tools/perf/tests/openat-syscall-all-cpus.c | 2 +-
49
tools/perf/tests/sw-clock.c | 2 +-
50
tools/perf/tests/switch-tracking.c | 2 +-
51
tools/perf/tests/task-exit.c | 2 +-
52
tools/perf/tests/topology.c | 2 +-
53
tools/perf/util/cpumap.c | 22 ----------------------
54
tools/perf/util/cpumap.h | 3 ---
55
tools/perf/util/cputopo.c | 4 ++--
56
tools/perf/util/env.c | 2 +-
57
tools/perf/util/event.c | 2 +-
58
tools/perf/util/evlist.c | 16 ++++++++--------
59
tools/perf/util/evsel.c | 4 ++--
60
tools/perf/util/parse-events.c | 4 ++--
61
tools/perf/util/pmu.c | 2 +-
62
tools/perf/util/python.c | 2 +-
63
tools/perf/util/record.c | 6 +++---
64
tools/perf/util/session.c | 2 +-
65
tools/perf/util/svghelper.c | 2 +-
66
33 files changed, 78 insertions(+), 75 deletions(-)
67
68
diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
69
index 268fcb31cd53..3a78b38e43ca 100644
70
--- a/tools/perf/arch/arm/util/cs-etm.c
71
+++ b/tools/perf/arch/arm/util/cs-etm.c
72
73
74
err = 0;
75
out:
76
- cpu_map__put(online_cpus);
77
+ perf_cpu_map__put(online_cpus);
78
return err;
79
}
80
81
82
}
83
}
84
85
- cpu_map__put(online_cpus);
86
+ perf_cpu_map__put(online_cpus);
87
88
return (CS_ETM_HEADER_SIZE +
89
(etmv4 * CS_ETMV4_PRIV_SIZE) +
90
91
if (cpu_map__has(cpu_map, i))
92
cs_etm_get_metadata(i, &offset, itr, info);
93
94
- cpu_map__put(online_cpus);
95
+ perf_cpu_map__put(online_cpus);
96
97
return 0;
98
}
99
diff --git a/tools/perf/arch/arm64/util/header.c b/tools/perf/arch/arm64/util/header.c
100
index b3e73a413f5a..602caf550e7f 100644
101
--- a/tools/perf/arch/arm64/util/header.c
102
+++ b/tools/perf/arch/arm64/util/header.c
103
104
return NULL;
105
106
/* read midr from list of cpus mapped to this pmu */
107
- cpus = cpu_map__get(pmu->cpus);
108
+ cpus = perf_cpu_map__get(pmu->cpus);
109
for (cpu = 0; cpu < cpus->nr; cpu++) {
110
scnprintf(path, PATH_MAX, "%s/devices/system/cpu/cpu%d"MIDR,
111
sysfs, cpus->map[cpu]);
112
113
buf = NULL;
114
}
115
116
- cpu_map__put(cpus);
117
+ perf_cpu_map__put(cpus);
118
return buf;
119
}
120
diff --git a/tools/perf/builtin-ftrace.c b/tools/perf/builtin-ftrace.c
121
index 105ef2a17a9c..6943352b8d94 100644
122
--- a/tools/perf/builtin-ftrace.c
123
+++ b/tools/perf/builtin-ftrace.c
124
125
int ret;
126
127
ret = set_tracing_cpumask(cpumap);
128
- cpu_map__put(cpumap);
129
+ perf_cpu_map__put(cpumap);
130
return ret;
131
}
132
133
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
134
index 36e66a4f3c57..39bd73d0e06e 100644
135
--- a/tools/perf/builtin-stat.c
136
+++ b/tools/perf/builtin-stat.c
137
138
139
static void perf_stat__exit_aggr_mode(void)
140
{
141
- cpu_map__put(stat_config.aggr_map);
142
- cpu_map__put(stat_config.cpus_aggr_map);
143
+ perf_cpu_map__put(stat_config.aggr_map);
144
+ perf_cpu_map__put(stat_config.cpus_aggr_map);
145
stat_config.aggr_map = NULL;
146
stat_config.cpus_aggr_map = NULL;
147
}
148
diff --git a/tools/perf/lib/cpumap.c b/tools/perf/lib/cpumap.c
149
index 80d587ab95aa..f3cfb4c71106 100644
150
--- a/tools/perf/lib/cpumap.c
151
+++ b/tools/perf/lib/cpumap.c
152
153
#include <stdlib.h>
154
#include <linux/refcount.h>
155
#include <internal/cpumap.h>
156
+#include <asm/bug.h>
157
+#include <stdio.h>
158
159
struct perf_cpu_map *perf_cpu_map__dummy_new(void)
160
{
161
162
163
return cpus;
164
}
165
+
166
+static void cpu_map__delete(struct perf_cpu_map *map)
167
+{
168
+ if (map) {
169
+ WARN_ONCE(refcount_read(&map->refcnt) != 0,
170
+ "cpu_map refcnt unbalanced\n");
171
+ free(map);
172
+ }
173
+}
174
+
175
+struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map)
176
+{
177
+ if (map)
178
+ refcount_inc(&map->refcnt);
179
+ return map;
180
+}
181
+
182
+void perf_cpu_map__put(struct perf_cpu_map *map)
183
+{
184
+ if (map && refcount_dec_and_test(&map->refcnt))
185
+ cpu_map__delete(map);
186
+}
187
diff --git a/tools/perf/lib/include/perf/cpumap.h b/tools/perf/lib/include/perf/cpumap.h
188
index fa1e5aa9d662..e16c2515a499 100644
189
--- a/tools/perf/lib/include/perf/cpumap.h
190
+++ b/tools/perf/lib/include/perf/cpumap.h
191
192
struct perf_cpu_map;
193
194
LIBPERF_API struct perf_cpu_map *perf_cpu_map__dummy_new(void);
195
+LIBPERF_API struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map);
196
+LIBPERF_API void perf_cpu_map__put(struct perf_cpu_map *map);
197
198
#endif /* __LIBPERF_CPUMAP_H */
199
diff --git a/tools/perf/lib/libperf.map b/tools/perf/lib/libperf.map
200
index 65201c6cbe7e..76ce3bc59dd8 100644
201
--- a/tools/perf/lib/libperf.map
202
+++ b/tools/perf/lib/libperf.map
203
204
global:
205
libperf_set_print;
206
perf_cpu_map__dummy_new;
207
+ perf_cpu_map__get;
208
+ perf_cpu_map__put;
209
local:
210
*;
211
};
212
diff --git a/tools/perf/tests/bitmap.c b/tools/perf/tests/bitmap.c
213
index 74d0cd32a5c4..95304d29092e 100644
214
--- a/tools/perf/tests/bitmap.c
215
+++ b/tools/perf/tests/bitmap.c
216
217
}
218
219
if (map)
220
- cpu_map__put(map);
221
+ perf_cpu_map__put(map);
222
return bm;
223
}
224
225
diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
226
index ec4b0bf28270..ce2d3266286a 100644
227
--- a/tools/perf/tests/code-reading.c
228
+++ b/tools/perf/tests/code-reading.c
229
230
* and will be freed by following perf_evlist__set_maps
231
* call. Getting refference to keep them alive.
232
*/
233
- cpu_map__get(cpus);
234
+ perf_cpu_map__get(cpus);
235
thread_map__get(threads);
236
perf_evlist__set_maps(evlist, NULL, NULL);
237
evlist__delete(evlist);
238
239
if (evlist) {
240
evlist__delete(evlist);
241
} else {
242
- cpu_map__put(cpus);
243
+ perf_cpu_map__put(cpus);
244
thread_map__put(threads);
245
}
246
machine__delete_threads(machine);
247
diff --git a/tools/perf/tests/cpumap.c b/tools/perf/tests/cpumap.c
248
index 10da4400493d..6c921087b0fe 100644
249
--- a/tools/perf/tests/cpumap.c
250
+++ b/tools/perf/tests/cpumap.c
251
252
TEST_ASSERT_VAL("wrong cpu", map->map[i] == i);
253
}
254
255
- cpu_map__put(map);
256
+ perf_cpu_map__put(map);
257
return 0;
258
}
259
260
261
TEST_ASSERT_VAL("wrong cpu", map->map[0] == 1);
262
TEST_ASSERT_VAL("wrong cpu", map->map[1] == 256);
263
TEST_ASSERT_VAL("wrong refcnt", refcount_read(&map->refcnt) == 1);
264
- cpu_map__put(map);
265
+ perf_cpu_map__put(map);
266
return 0;
267
}
268
269
270
TEST_ASSERT_VAL("failed to synthesize map",
271
!perf_event__synthesize_cpu_map(NULL, cpus, process_event_mask, NULL));
272
273
- cpu_map__put(cpus);
274
+ perf_cpu_map__put(cpus);
275
276
/* This one is better stores in cpu values. */
277
cpus = cpu_map__new("1,256");
278
279
TEST_ASSERT_VAL("failed to synthesize map",
280
!perf_event__synthesize_cpu_map(NULL, cpus, process_event_cpus, NULL));
281
282
- cpu_map__put(cpus);
283
+ perf_cpu_map__put(cpus);
284
return 0;
285
}
286
287
diff --git a/tools/perf/tests/event-times.c b/tools/perf/tests/event-times.c
288
index bf00d3d792fb..dcfff4b20c92 100644
289
--- a/tools/perf/tests/event-times.c
290
+++ b/tools/perf/tests/event-times.c
291
292
return err;
293
}
294
295
- cpu_map__put(cpus);
296
+ perf_cpu_map__put(cpus);
297
return evsel__enable(evsel);
298
}
299
300
301
if (err == -EACCES)
302
return TEST_SKIP;
303
304
- cpu_map__put(cpus);
305
+ perf_cpu_map__put(cpus);
306
return err ? TEST_FAIL : TEST_OK;
307
}
308
309
diff --git a/tools/perf/tests/event_update.c b/tools/perf/tests/event_update.c
310
index eb0dd359762d..415d12e96834 100644
311
--- a/tools/perf/tests/event_update.c
312
+++ b/tools/perf/tests/event_update.c
313
314
TEST_ASSERT_VAL("wrong cpus", map->map[0] == 1);
315
TEST_ASSERT_VAL("wrong cpus", map->map[1] == 2);
316
TEST_ASSERT_VAL("wrong cpus", map->map[2] == 3);
317
- cpu_map__put(map);
318
+ perf_cpu_map__put(map);
319
return 0;
320
}
321
322
323
TEST_ASSERT_VAL("failed to synthesize attr update cpus",
324
!perf_event__synthesize_event_update_cpus(&tmp.tool, evsel, process_event_cpus));
325
326
- cpu_map__put(evsel->own_cpus);
327
+ perf_cpu_map__put(evsel->own_cpus);
328
return 0;
329
}
330
diff --git a/tools/perf/tests/keep-tracking.c b/tools/perf/tests/keep-tracking.c
331
index 7bfc859971e5..43e55fe98f8c 100644
332
--- a/tools/perf/tests/keep-tracking.c
333
+++ b/tools/perf/tests/keep-tracking.c
334
335
evlist__disable(evlist);
336
evlist__delete(evlist);
337
} else {
338
- cpu_map__put(cpus);
339
+ perf_cpu_map__put(cpus);
340
thread_map__put(threads);
341
}
342
343
diff --git a/tools/perf/tests/mem2node.c b/tools/perf/tests/mem2node.c
344
index e12eedfba781..6fe2c1e7918b 100644
345
--- a/tools/perf/tests/mem2node.c
346
+++ b/tools/perf/tests/mem2node.c
347
348
}
349
350
if (map)
351
- cpu_map__put(map);
352
+ perf_cpu_map__put(map);
353
else
354
free(bm);
355
356
diff --git a/tools/perf/tests/mmap-basic.c b/tools/perf/tests/mmap-basic.c
357
index 40511025208f..d15282174b2e 100644
358
--- a/tools/perf/tests/mmap-basic.c
359
+++ b/tools/perf/tests/mmap-basic.c
360
361
cpus = NULL;
362
threads = NULL;
363
out_free_cpus:
364
- cpu_map__put(cpus);
365
+ perf_cpu_map__put(cpus);
366
out_free_threads:
367
thread_map__put(threads);
368
return err;
369
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c b/tools/perf/tests/openat-syscall-all-cpus.c
370
index f96cbd304024..611f6ea9b702 100644
371
--- a/tools/perf/tests/openat-syscall-all-cpus.c
372
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
373
374
out_evsel_delete:
375
evsel__delete(evsel);
376
out_cpu_map_delete:
377
- cpu_map__put(cpus);
378
+ perf_cpu_map__put(cpus);
379
out_thread_map_delete:
380
thread_map__put(threads);
381
return err;
382
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c
383
index c6d3f4488b73..c464e301ade9 100644
384
--- a/tools/perf/tests/sw-clock.c
385
+++ b/tools/perf/tests/sw-clock.c
386
387
}
388
389
out_free_maps:
390
- cpu_map__put(cpus);
391
+ perf_cpu_map__put(cpus);
392
thread_map__put(threads);
393
out_delete_evlist:
394
evlist__delete(evlist);
395
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
396
index d5537edb47db..27af7b7109a3 100644
397
--- a/tools/perf/tests/switch-tracking.c
398
+++ b/tools/perf/tests/switch-tracking.c
399
400
evlist__disable(evlist);
401
evlist__delete(evlist);
402
} else {
403
- cpu_map__put(cpus);
404
+ perf_cpu_map__put(cpus);
405
thread_map__put(threads);
406
}
407
408
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c
409
index c094fb8cc877..f026759a05d7 100644
410
--- a/tools/perf/tests/task-exit.c
411
+++ b/tools/perf/tests/task-exit.c
412
413
}
414
415
out_free_maps:
416
- cpu_map__put(cpus);
417
+ perf_cpu_map__put(cpus);
418
thread_map__put(threads);
419
out_delete_evlist:
420
evlist__delete(evlist);
421
diff --git a/tools/perf/tests/topology.c b/tools/perf/tests/topology.c
422
index 443d0272ebbd..1b57ded58d59 100644
423
--- a/tools/perf/tests/topology.c
424
+++ b/tools/perf/tests/topology.c
425
426
}
427
428
ret = check_cpu_topology(path, map);
429
- cpu_map__put(map);
430
+ perf_cpu_map__put(map);
431
432
free_path:
433
unlink(path);
434
diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
435
index acda9bfb4002..44082e5eabde 100644
436
--- a/tools/perf/util/cpumap.c
437
+++ b/tools/perf/util/cpumap.c
438
439
return cpus;
440
}
441
442
-static void cpu_map__delete(struct perf_cpu_map *map)
443
-{
444
- if (map) {
445
- WARN_ONCE(refcount_read(&map->refcnt) != 0,
446
- "cpu_map refcnt unbalanced\n");
447
- free(map);
448
- }
449
-}
450
-
451
-struct perf_cpu_map *cpu_map__get(struct perf_cpu_map *map)
452
-{
453
- if (map)
454
- refcount_inc(&map->refcnt);
455
- return map;
456
-}
457
-
458
-void cpu_map__put(struct perf_cpu_map *map)
459
-{
460
- if (map && refcount_dec_and_test(&map->refcnt))
461
- cpu_map__delete(map);
462
-}
463
-
464
static int cpu__get_topology_int(int cpu, const char *name, int *value)
465
{
466
char path[PATH_MAX];
467
diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h
468
index 0ce3f6bd9449..b7af2cb68c19 100644
469
--- a/tools/perf/util/cpumap.h
470
+++ b/tools/perf/util/cpumap.h
471
472
int cpu_map__build_core_map(struct perf_cpu_map *cpus, struct perf_cpu_map **corep);
473
const struct perf_cpu_map *cpu_map__online(void); /* thread unsafe */
474
475
-struct perf_cpu_map *cpu_map__get(struct perf_cpu_map *map);
476
-void cpu_map__put(struct perf_cpu_map *map);
477
-
478
static inline int cpu_map__socket(struct perf_cpu_map *sock, int s)
479
{
480
if (!sock || s > sock->nr || s < 0)
481
diff --git a/tools/perf/util/cputopo.c b/tools/perf/util/cputopo.c
482
index 157b0988435e..0cd99c460cd4 100644
483
--- a/tools/perf/util/cputopo.c
484
+++ b/tools/perf/util/cputopo.c
485
486
}
487
488
out_free:
489
- cpu_map__put(map);
490
+ perf_cpu_map__put(map);
491
if (ret) {
492
cpu_topology__delete(tp);
493
tp = NULL;
494
495
out:
496
free(buf);
497
fclose(fp);
498
- cpu_map__put(node_map);
499
+ perf_cpu_map__put(node_map);
500
return tp;
501
}
502
503
diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c
504
index 9909ec40c6d2..d77912b2b5e7 100644
505
--- a/tools/perf/util/env.c
506
+++ b/tools/perf/util/env.c
507
508
zfree(&env->cpu);
509
510
for (i = 0; i < env->nr_numa_nodes; i++)
511
- cpu_map__put(env->numa_nodes[i].map);
512
+ perf_cpu_map__put(env->numa_nodes[i].map);
513
zfree(&env->numa_nodes);
514
515
for (i = 0; i < env->caches_cnt; i++)
516
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
517
index f78837788b14..1a3db35f9f7d 100644
518
--- a/tools/perf/util/event.c
519
+++ b/tools/perf/util/event.c
520
521
else
522
ret += fprintf(fp, "failed to get cpumap from event\n");
523
524
- cpu_map__put(cpus);
525
+ perf_cpu_map__put(cpus);
526
return ret;
527
}
528
529
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
530
index 461c1e68e9e7..35020d50f51e 100644
531
--- a/tools/perf/util/evlist.c
532
+++ b/tools/perf/util/evlist.c
533
534
535
perf_evlist__munmap(evlist);
536
evlist__close(evlist);
537
- cpu_map__put(evlist->cpus);
538
+ perf_cpu_map__put(evlist->cpus);
539
thread_map__put(evlist->threads);
540
evlist->cpus = NULL;
541
evlist->threads = NULL;
542
543
* keep it, if there's no target cpu list defined.
544
*/
545
if (!evsel->own_cpus || evlist->has_user_cpus) {
546
- cpu_map__put(evsel->cpus);
547
- evsel->cpus = cpu_map__get(evlist->cpus);
548
+ perf_cpu_map__put(evsel->cpus);
549
+ evsel->cpus = perf_cpu_map__get(evlist->cpus);
550
} else if (evsel->cpus != evsel->own_cpus) {
551
- cpu_map__put(evsel->cpus);
552
- evsel->cpus = cpu_map__get(evsel->own_cpus);
553
+ perf_cpu_map__put(evsel->cpus);
554
+ evsel->cpus = perf_cpu_map__get(evsel->own_cpus);
555
}
556
557
thread_map__put(evsel->threads);
558
559
* the caller to increase the reference count.
560
*/
561
if (cpus != evlist->cpus) {
562
- cpu_map__put(evlist->cpus);
563
- evlist->cpus = cpu_map__get(cpus);
564
+ perf_cpu_map__put(evlist->cpus);
565
+ evlist->cpus = perf_cpu_map__get(cpus);
566
}
567
568
if (threads != evlist->threads) {
569
570
out:
571
return err;
572
out_put:
573
- cpu_map__put(cpus);
574
+ perf_cpu_map__put(cpus);
575
goto out;
576
}
577
578
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
579
index a389752840a9..72c0e6948e83 100644
580
--- a/tools/perf/util/evsel.c
581
+++ b/tools/perf/util/evsel.c
582
583
perf_evsel__free_id(evsel);
584
perf_evsel__free_config_terms(evsel);
585
cgroup__put(evsel->cgrp);
586
- cpu_map__put(evsel->cpus);
587
- cpu_map__put(evsel->own_cpus);
588
+ perf_cpu_map__put(evsel->cpus);
589
+ perf_cpu_map__put(evsel->own_cpus);
590
thread_map__put(evsel->threads);
591
zfree(&evsel->group_name);
592
zfree(&evsel->name);
593
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
594
index decb66d243ca..8c9928feb38a 100644
595
--- a/tools/perf/util/parse-events.c
596
+++ b/tools/perf/util/parse-events.c
597
598
return NULL;
599
600
(*idx)++;
601
- evsel->cpus = cpu_map__get(cpus);
602
- evsel->own_cpus = cpu_map__get(cpus);
603
+ evsel->cpus = perf_cpu_map__get(cpus);
604
+ evsel->own_cpus = perf_cpu_map__get(cpus);
605
evsel->system_wide = pmu ? pmu->is_uncore : false;
606
evsel->auto_merge_stats = auto_merge_stats;
607
608
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
609
index 4929a50c0973..d355f9506a1c 100644
610
--- a/tools/perf/util/pmu.c
611
+++ b/tools/perf/util/pmu.c
612
613
614
snprintf(path, PATH_MAX, CPUS_TEMPLATE_UNCORE, sysfs, name);
615
cpus = __pmu_cpumask(path);
616
- cpu_map__put(cpus);
617
+ perf_cpu_map__put(cpus);
618
619
return !!cpus;
620
}
621
diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c
622
index cc4af99ab190..677c93f91c6c 100644
623
--- a/tools/perf/util/python.c
624
+++ b/tools/perf/util/python.c
625
626
627
static void pyrf_cpu_map__delete(struct pyrf_cpu_map *pcpus)
628
{
629
- cpu_map__put(pcpus->cpus);
630
+ perf_cpu_map__put(pcpus->cpus);
631
Py_TYPE(pcpus)->tp_free((PyObject*)pcpus);
632
}
633
634
diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c
635
index 9f8841548539..fecccfd71aa1 100644
636
--- a/tools/perf/util/record.c
637
+++ b/tools/perf/util/record.c
638
639
if (!cpus)
640
return false;
641
cpu = cpus->map[0];
642
- cpu_map__put(cpus);
643
+ perf_cpu_map__put(cpus);
644
645
do {
646
ret = perf_do_probe_api(fn, cpu, try[i++]);
647
648
if (!cpus)
649
return false;
650
cpu = cpus->map[0];
651
- cpu_map__put(cpus);
652
+ perf_cpu_map__put(cpus);
653
654
fd = sys_perf_event_open(&attr, -1, cpu, -1, 0);
655
if (fd < 0)
656
657
struct perf_cpu_map *cpus = cpu_map__new(NULL);
658
659
cpu = cpus ? cpus->map[0] : 0;
660
- cpu_map__put(cpus);
661
+ perf_cpu_map__put(cpus);
662
} else {
663
cpu = evlist->cpus->map[0];
664
}
665
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
666
index c191dc152175..62d37440cbee 100644
667
--- a/tools/perf/util/session.c
668
+++ b/tools/perf/util/session.c
669
670
err = 0;
671
672
out_delete_map:
673
- cpu_map__put(map);
674
+ perf_cpu_map__put(map);
675
return err;
676
}
677
678
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c
679
index 99132c6a30a6..a9ca5c4fffee 100644
680
--- a/tools/perf/util/svghelper.c
681
+++ b/tools/perf/util/svghelper.c
682
683
set_bit(c, cpumask_bits(b));
684
}
685
686
- cpu_map__put(m);
687
+ perf_cpu_map__put(m);
688
689
return ret;
690
}
691
692