summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2015-09-08 03:59:00 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-09-15 10:03:22 -0400
commit8c0498b6891d7ca5c379c6283de7fc7fe8eebe5c (patch)
treef2a1a8c3a5fb7f59191c183c8b9b9f793ecb8803 /tools
parent44c42d71c659527c81bf169808959c9339116d85 (diff)
perf evlist: Fix create_syswide_maps() not propagating maps
Fix it by making it call perf_evlist__set_maps() instead of setting the maps itself. 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-13-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.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 99267ab0d24a..c8fc8a258f42 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1400,6 +1400,8 @@ void perf_evlist__close(struct perf_evlist *evlist)
1400 1400
1401static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist) 1401static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist)
1402{ 1402{
1403 struct cpu_map *cpus;
1404 struct thread_map *threads;
1403 int err = -ENOMEM; 1405 int err = -ENOMEM;
1404 1406
1405 /* 1407 /*
@@ -1411,20 +1413,19 @@ static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist)
1411 * error, and we may not want to do that fallback to a 1413 * error, and we may not want to do that fallback to a
1412 * default cpu identity map :-\ 1414 * default cpu identity map :-\
1413 */ 1415 */
1414 evlist->cpus = cpu_map__new(NULL); 1416 cpus = cpu_map__new(NULL);
1415 if (evlist->cpus == NULL) 1417 if (!cpus)
1416 goto out; 1418 goto out;
1417 1419
1418 evlist->threads = thread_map__new_dummy(); 1420 threads = thread_map__new_dummy();
1419 if (evlist->threads == NULL) 1421 if (!threads)
1420 goto out_free_cpus; 1422 goto out_put;
1421 1423
1422 err = 0; 1424 perf_evlist__set_maps(evlist, cpus, threads);
1423out: 1425out:
1424 return err; 1426 return err;
1425out_free_cpus: 1427out_put:
1426 cpu_map__put(evlist->cpus); 1428 cpu_map__put(cpus);
1427 evlist->cpus = NULL;
1428 goto out; 1429 goto out;
1429} 1430}
1430 1431