Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf evlist: Propagate thread maps through the evlist

Propagate evlist's thread_map object through all the evsel objects.

It'll be handy to access evsel's threads directly in following patches.
The reason is there's no link from evsel to evlist which hold threads
map now and evlist is not always available.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1435012588-9007-7-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
578e91ec b7f0c203

+5 -1
+3 -1
tools/perf/util/evlist.c
··· 1117 1117 if (!evsel->cpus || target->cpu_list) 1118 1118 evsel->cpus = cpu_map__get(evlist->cpus); 1119 1119 1120 - if (!evsel->cpus) 1120 + evsel->threads = thread_map__get(evlist->threads); 1121 + 1122 + if (!evsel->cpus || !evsel->threads) 1121 1123 return -ENOMEM; 1122 1124 } 1123 1125
+1
tools/perf/util/evsel.c
··· 886 886 perf_evsel__free_id(evsel); 887 887 close_cgroup(evsel->cgrp); 888 888 cpu_map__put(evsel->cpus); 889 + thread_map__put(evsel->threads); 889 890 zfree(&evsel->group_name); 890 891 zfree(&evsel->name); 891 892 perf_evsel__object.fini(evsel);
+1
tools/perf/util/evsel.h
··· 82 82 struct cgroup_sel *cgrp; 83 83 void *handler; 84 84 struct cpu_map *cpus; 85 + struct thread_map *threads; 85 86 unsigned int sample_size; 86 87 int id_pos; 87 88 int is_pos;