diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2015-09-08 03:58:57 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-09-15 09:45:47 -0400 |
commit | 74bfd2b25de354feb4484c553dce4fe8d9c3b60b (patch) | |
tree | ad64a19e0217f1bfa6c085decf4618f9aac1cd4b /tools | |
parent | 934e0f2053ce299893ca48a411bf7fdc8ac6254f (diff) |
perf evlist: Make create_maps() use set_maps()
Since there is a function to set maps, perf_evlist__create_maps() should
use it.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Link: http://lkml.kernel.org/r/1441699142-18905-10-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evlist.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index 78ff52ee8788..c17f3558a37a 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -1126,29 +1126,30 @@ static void perf_evlist__propagate_maps(struct perf_evlist *evlist) | |||
1126 | 1126 | ||
1127 | int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) | 1127 | int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) |
1128 | { | 1128 | { |
1129 | evlist->threads = thread_map__new_str(target->pid, target->tid, | 1129 | struct cpu_map *cpus; |
1130 | target->uid); | 1130 | struct thread_map *threads; |
1131 | 1131 | ||
1132 | if (evlist->threads == NULL) | 1132 | threads = thread_map__new_str(target->pid, target->tid, target->uid); |
1133 | |||
1134 | if (!threads) | ||
1133 | return -1; | 1135 | return -1; |
1134 | 1136 | ||
1135 | if (target__uses_dummy_map(target)) | 1137 | if (target__uses_dummy_map(target)) |
1136 | evlist->cpus = cpu_map__dummy_new(); | 1138 | cpus = cpu_map__dummy_new(); |
1137 | else | 1139 | else |
1138 | evlist->cpus = cpu_map__new(target->cpu_list); | 1140 | cpus = cpu_map__new(target->cpu_list); |
1139 | 1141 | ||
1140 | if (evlist->cpus == NULL) | 1142 | if (!cpus) |
1141 | goto out_delete_threads; | 1143 | goto out_delete_threads; |
1142 | 1144 | ||
1143 | evlist->has_user_cpus = !!target->cpu_list; | 1145 | evlist->has_user_cpus = !!target->cpu_list; |
1144 | 1146 | ||
1145 | perf_evlist__propagate_maps(evlist); | 1147 | perf_evlist__set_maps(evlist, cpus, threads); |
1146 | 1148 | ||
1147 | return 0; | 1149 | return 0; |
1148 | 1150 | ||
1149 | out_delete_threads: | 1151 | out_delete_threads: |
1150 | thread_map__put(evlist->threads); | 1152 | thread_map__put(threads); |
1151 | evlist->threads = NULL; | ||
1152 | return -1; | 1153 | return -1; |
1153 | } | 1154 | } |
1154 | 1155 | ||