diff options
Diffstat (limited to 'tools/perf/util/evlist.c')
-rw-r--r-- | tools/perf/util/evlist.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 1986d8051bd1..1201daf71719 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <poll.h> | 11 | #include <poll.h> |
12 | #include "cpumap.h" | 12 | #include "cpumap.h" |
13 | #include "thread_map.h" | 13 | #include "thread_map.h" |
14 | #include "target.h" | ||
14 | #include "evlist.h" | 15 | #include "evlist.h" |
15 | #include "evsel.h" | 16 | #include "evsel.h" |
16 | #include <unistd.h> | 17 | #include <unistd.h> |
@@ -599,18 +600,19 @@ int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, | |||
599 | return perf_evlist__mmap_per_cpu(evlist, prot, mask); | 600 | return perf_evlist__mmap_per_cpu(evlist, prot, mask); |
600 | } | 601 | } |
601 | 602 | ||
602 | int perf_evlist__create_maps(struct perf_evlist *evlist, const char *target_pid, | 603 | int perf_evlist__create_maps(struct perf_evlist *evlist, |
603 | const char *target_tid, uid_t uid, const char *cpu_list) | 604 | struct perf_target *target) |
604 | { | 605 | { |
605 | evlist->threads = thread_map__new_str(target_pid, target_tid, uid); | 606 | evlist->threads = thread_map__new_str(target->pid, target->tid, |
607 | target->uid); | ||
606 | 608 | ||
607 | if (evlist->threads == NULL) | 609 | if (evlist->threads == NULL) |
608 | return -1; | 610 | return -1; |
609 | 611 | ||
610 | if (uid != UINT_MAX || (cpu_list == NULL && target_tid)) | 612 | if (!perf_target__no_cpu(target)) |
611 | evlist->cpus = cpu_map__dummy_new(); | 613 | evlist->cpus = cpu_map__new(target->cpu_list); |
612 | else | 614 | else |
613 | evlist->cpus = cpu_map__new(cpu_list); | 615 | evlist->cpus = cpu_map__dummy_new(); |
614 | 616 | ||
615 | if (evlist->cpus == NULL) | 617 | if (evlist->cpus == NULL) |
616 | goto out_delete_threads; | 618 | goto out_delete_threads; |
@@ -827,7 +829,7 @@ int perf_evlist__prepare_workload(struct perf_evlist *evlist, | |||
827 | exit(-1); | 829 | exit(-1); |
828 | } | 830 | } |
829 | 831 | ||
830 | if (!opts->system_wide && !opts->target_tid && !opts->target_pid) | 832 | if (perf_target__none(&opts->target)) |
831 | evlist->threads->map[0] = evlist->workload.pid; | 833 | evlist->threads->map[0] = evlist->workload.pid; |
832 | 834 | ||
833 | close(child_ready_pipe[1]); | 835 | close(child_ready_pipe[1]); |