aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/cpumap.h2
-rw-r--r--tools/perf/util/evlist.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/cpumap.h b/tools/perf/util/cpumap.h
index 9bed02e5fb3d..b123bb9d6f55 100644
--- a/tools/perf/util/cpumap.h
+++ b/tools/perf/util/cpumap.h
@@ -41,7 +41,7 @@ static inline int cpu_map__nr(const struct cpu_map *map)
41 return map ? map->nr : 1; 41 return map ? map->nr : 1;
42} 42}
43 43
44static inline bool cpu_map__all(const struct cpu_map *map) 44static inline bool cpu_map__empty(const struct cpu_map *map)
45{ 45{
46 return map ? map->map[0] == -1 : true; 46 return map ? map->map[0] == -1 : true;
47} 47}
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 8065ce8fa9a5..4a901be599ed 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -421,7 +421,7 @@ void perf_evlist__munmap(struct perf_evlist *evlist)
421static int perf_evlist__alloc_mmap(struct perf_evlist *evlist) 421static int perf_evlist__alloc_mmap(struct perf_evlist *evlist)
422{ 422{
423 evlist->nr_mmaps = cpu_map__nr(evlist->cpus); 423 evlist->nr_mmaps = cpu_map__nr(evlist->cpus);
424 if (cpu_map__all(evlist->cpus)) 424 if (cpu_map__empty(evlist->cpus))
425 evlist->nr_mmaps = thread_map__nr(evlist->threads); 425 evlist->nr_mmaps = thread_map__nr(evlist->threads);
426 evlist->mmap = zalloc(evlist->nr_mmaps * sizeof(struct perf_mmap)); 426 evlist->mmap = zalloc(evlist->nr_mmaps * sizeof(struct perf_mmap));
427 return evlist->mmap != NULL ? 0 : -ENOMEM; 427 return evlist->mmap != NULL ? 0 : -ENOMEM;
@@ -573,7 +573,7 @@ int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages,
573 return -ENOMEM; 573 return -ENOMEM;
574 } 574 }
575 575
576 if (cpu_map__all(cpus)) 576 if (cpu_map__empty(cpus))
577 return perf_evlist__mmap_per_thread(evlist, prot, mask); 577 return perf_evlist__mmap_per_thread(evlist, prot, mask);
578 578
579 return perf_evlist__mmap_per_cpu(evlist, prot, mask); 579 return perf_evlist__mmap_per_cpu(evlist, prot, mask);