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>
This commit is contained in:
parent
934e0f2053
commit
74bfd2b25d
1 changed files with 10 additions and 9 deletions
|
@ -1126,29 +1126,30 @@ static void perf_evlist__propagate_maps(struct perf_evlist *evlist)
|
||||||
|
|
||||||
int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
|
int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
|
||||||
{
|
{
|
||||||
evlist->threads = thread_map__new_str(target->pid, target->tid,
|
struct cpu_map *cpus;
|
||||||
target->uid);
|
struct thread_map *threads;
|
||||||
|
|
||||||
if (evlist->threads == NULL)
|
threads = thread_map__new_str(target->pid, target->tid, target->uid);
|
||||||
|
|
||||||
|
if (!threads)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (target__uses_dummy_map(target))
|
if (target__uses_dummy_map(target))
|
||||||
evlist->cpus = cpu_map__dummy_new();
|
cpus = cpu_map__dummy_new();
|
||||||
else
|
else
|
||||||
evlist->cpus = cpu_map__new(target->cpu_list);
|
cpus = cpu_map__new(target->cpu_list);
|
||||||
|
|
||||||
if (evlist->cpus == NULL)
|
if (!cpus)
|
||||||
goto out_delete_threads;
|
goto out_delete_threads;
|
||||||
|
|
||||||
evlist->has_user_cpus = !!target->cpu_list;
|
evlist->has_user_cpus = !!target->cpu_list;
|
||||||
|
|
||||||
perf_evlist__propagate_maps(evlist);
|
perf_evlist__set_maps(evlist, cpus, threads);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_delete_threads:
|
out_delete_threads:
|
||||||
thread_map__put(evlist->threads);
|
thread_map__put(threads);
|
||||||
evlist->threads = NULL;
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue