diff options
author | Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> | 2013-05-22 20:42:38 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-07-12 12:45:44 -0400 |
commit | ec1e7e437ac47ecf7b4e07241036b1e1c3366012 (patch) | |
tree | 447a172da806ecb9b02a6b3698bf8517c99a8789 /tools/perf/util/evlist.c | |
parent | 67516844625f45f0ce148a01c27bf41f591872b2 (diff) |
perf tools: Rename cpu_map__all() to cpu_map__empty()
The CPU map is in an "empty" (or not-applicable) state when monitoring
specific threads.
cpu_map__all() returns true if the CPU map is in this empty state (i.e
for the 'empty_cpu_map' or if we created the map via
cpu_map__dummy_new().
The name, cpu_map__all(), is misleading, because even when monitoring
all CPUs, (eg: perf record -a), cpu_map__all() returns false.
Rename cpu_map__all() to cpu_map__empty().
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/20130523012620.GA27733@us.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evlist.c')
-rw-r--r-- | tools/perf/util/evlist.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
421 | static int perf_evlist__alloc_mmap(struct perf_evlist *evlist) | 421 | static 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); |