diff options
author | Dongsheng Yang <yangds.fnst@cn.fujitsu.com> | 2013-12-04 17:56:40 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-04 11:46:37 -0500 |
commit | 9c105fbc94a67ea5943d309d9a78ca669e0ddc61 (patch) | |
tree | 0de6e9599cbd1bd1e2a58cdb5050818be1b8ec1a /tools/perf/util/evlist.c | |
parent | 2f37573507643407d0a8f38c676ed2e90b795db3 (diff) |
perf target: Move the checking of which map function to call into function.
Check for cpu_map__dummy_new() or cpu_map__new() to be called in
perf_evlist__create_maps() is more complicated.
This patch moves the checking work into target.h, combining two
conditions and making perf_evlist__create_maps() more readable.
Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/b8c41f1fd2c4f0df71eb7b19aea74fb64d46cdda.1386197481.git.yangds.fnst@cn.fujitsu.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 | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 76fa76431329..7bb6ee1ca19f 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -819,13 +819,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) | |||
819 | if (evlist->threads == NULL) | 819 | if (evlist->threads == NULL) |
820 | return -1; | 820 | return -1; |
821 | 821 | ||
822 | if (target->default_per_cpu) | 822 | if (target__uses_dummy_map(target)) |
823 | evlist->cpus = target->per_thread ? | ||
824 | cpu_map__dummy_new() : | ||
825 | cpu_map__new(target->cpu_list); | ||
826 | else if (target__has_task(target)) | ||
827 | evlist->cpus = cpu_map__dummy_new(); | ||
828 | else if (!target__has_cpu(target) && !target->uses_mmap) | ||
829 | evlist->cpus = cpu_map__dummy_new(); | 823 | evlist->cpus = cpu_map__dummy_new(); |
830 | else | 824 | else |
831 | evlist->cpus = cpu_map__new(target->cpu_list); | 825 | evlist->cpus = cpu_map__new(target->cpu_list); |