diff options
Diffstat (limited to 'tools/perf/util/evlist.c')
-rw-r--r-- | tools/perf/util/evlist.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index ea32a061f1c8..159263d17c2d 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -97,9 +97,9 @@ void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry) | |||
97 | ++evlist->nr_entries; | 97 | ++evlist->nr_entries; |
98 | } | 98 | } |
99 | 99 | ||
100 | static void perf_evlist__splice_list_tail(struct perf_evlist *evlist, | 100 | void perf_evlist__splice_list_tail(struct perf_evlist *evlist, |
101 | struct list_head *list, | 101 | struct list_head *list, |
102 | int nr_entries) | 102 | int nr_entries) |
103 | { | 103 | { |
104 | list_splice_tail(list, &evlist->entries); | 104 | list_splice_tail(list, &evlist->entries); |
105 | evlist->nr_entries += nr_entries; | 105 | evlist->nr_entries += nr_entries; |
@@ -597,15 +597,15 @@ int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, | |||
597 | return perf_evlist__mmap_per_cpu(evlist, prot, mask); | 597 | return perf_evlist__mmap_per_cpu(evlist, prot, mask); |
598 | } | 598 | } |
599 | 599 | ||
600 | int perf_evlist__create_maps(struct perf_evlist *evlist, pid_t target_pid, | 600 | int perf_evlist__create_maps(struct perf_evlist *evlist, const char *target_pid, |
601 | pid_t target_tid, const char *cpu_list) | 601 | const char *target_tid, uid_t uid, const char *cpu_list) |
602 | { | 602 | { |
603 | evlist->threads = thread_map__new(target_pid, target_tid); | 603 | evlist->threads = thread_map__new_str(target_pid, target_tid, uid); |
604 | 604 | ||
605 | if (evlist->threads == NULL) | 605 | if (evlist->threads == NULL) |
606 | return -1; | 606 | return -1; |
607 | 607 | ||
608 | if (cpu_list == NULL && target_tid != -1) | 608 | if (uid != UINT_MAX || (cpu_list == NULL && target_tid)) |
609 | evlist->cpus = cpu_map__dummy_new(); | 609 | evlist->cpus = cpu_map__dummy_new(); |
610 | else | 610 | else |
611 | evlist->cpus = cpu_map__new(cpu_list); | 611 | evlist->cpus = cpu_map__new(cpu_list); |
@@ -765,6 +765,7 @@ out_err: | |||
765 | list_for_each_entry_reverse(evsel, &evlist->entries, node) | 765 | list_for_each_entry_reverse(evsel, &evlist->entries, node) |
766 | perf_evsel__close(evsel, ncpus, nthreads); | 766 | perf_evsel__close(evsel, ncpus, nthreads); |
767 | 767 | ||
768 | errno = -err; | ||
768 | return err; | 769 | return err; |
769 | } | 770 | } |
770 | 771 | ||
@@ -824,7 +825,7 @@ int perf_evlist__prepare_workload(struct perf_evlist *evlist, | |||
824 | exit(-1); | 825 | exit(-1); |
825 | } | 826 | } |
826 | 827 | ||
827 | if (!opts->system_wide && opts->target_tid == -1 && opts->target_pid == -1) | 828 | if (!opts->system_wide && !opts->target_tid && !opts->target_pid) |
828 | evlist->threads->map[0] = evlist->workload.pid; | 829 | evlist->threads->map[0] = evlist->workload.pid; |
829 | 830 | ||
830 | close(child_ready_pipe[1]); | 831 | close(child_ready_pipe[1]); |