diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-04-26 01:15:19 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-02 14:23:11 -0400 |
commit | b809ac100e2f12ebf1b58ff522dba15651a77d27 (patch) | |
tree | b5e4b894ed8cd8d0e1eb3e6252f2204f5bfae764 /tools/perf/util | |
parent | 4bd0f2d2c0cf14de9c84c2fe689120c6b0f667c8 (diff) |
perf evlist: Make create_maps() take struct perf_target
Now we have all information that needed to create cpu/thread maps in
struct perf_target, it'd be better using it as an argument.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1335417327-11796-6-git-send-email-namhyung.kim@lge.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/evlist.c | 12 | ||||
-rw-r--r-- | tools/perf/util/evlist.h | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 7080901a2717..a43e2c56d1c6 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -599,18 +599,20 @@ int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, | |||
599 | return perf_evlist__mmap_per_cpu(evlist, prot, mask); | 599 | return perf_evlist__mmap_per_cpu(evlist, prot, mask); |
600 | } | 600 | } |
601 | 601 | ||
602 | int perf_evlist__create_maps(struct perf_evlist *evlist, const char *target_pid, | 602 | int perf_evlist__create_maps(struct perf_evlist *evlist, |
603 | const char *target_tid, uid_t uid, const char *cpu_list) | 603 | struct perf_target *target) |
604 | { | 604 | { |
605 | evlist->threads = thread_map__new_str(target_pid, target_tid, uid); | 605 | evlist->threads = thread_map__new_str(target->pid, target->tid, |
606 | target->uid); | ||
606 | 607 | ||
607 | if (evlist->threads == NULL) | 608 | if (evlist->threads == NULL) |
608 | return -1; | 609 | return -1; |
609 | 610 | ||
610 | if (uid != UINT_MAX || (cpu_list == NULL && target_tid)) | 611 | if (target->uid != UINT_MAX || |
612 | (target->cpu_list == NULL && target->tid)) | ||
611 | evlist->cpus = cpu_map__dummy_new(); | 613 | evlist->cpus = cpu_map__dummy_new(); |
612 | else | 614 | else |
613 | evlist->cpus = cpu_map__new(cpu_list); | 615 | evlist->cpus = cpu_map__new(target->cpu_list); |
614 | 616 | ||
615 | if (evlist->cpus == NULL) | 617 | if (evlist->cpus == NULL) |
616 | goto out_delete_threads; | 618 | goto out_delete_threads; |
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index 21f1c9e57f13..58abb63ac13a 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -106,8 +106,8 @@ static inline void perf_evlist__set_maps(struct perf_evlist *evlist, | |||
106 | evlist->threads = threads; | 106 | evlist->threads = threads; |
107 | } | 107 | } |
108 | 108 | ||
109 | int perf_evlist__create_maps(struct perf_evlist *evlist, const char *target_pid, | 109 | int perf_evlist__create_maps(struct perf_evlist *evlist, |
110 | const char *tid, uid_t uid, const char *cpu_list); | 110 | struct perf_target *target); |
111 | void perf_evlist__delete_maps(struct perf_evlist *evlist); | 111 | void perf_evlist__delete_maps(struct perf_evlist *evlist); |
112 | int perf_evlist__set_filters(struct perf_evlist *evlist); | 112 | int perf_evlist__set_filters(struct perf_evlist *evlist); |
113 | 113 | ||