aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-08-25 15:09:21 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-08-30 09:56:34 -0400
commitb01141f4f59ce56e5ed177a1fc70b3ba4d676aca (patch)
treea4d7be51790bb2e80b09100588029b51bbe33179 /tools/perf/builtin-annotate.c
parentffe67c2fabf128122b30fbf0ac498928e171b0b3 (diff)
perf annotate: Initialize the priv are in symbol__new()
We need to initializa some fields (right now just a mutex) when we allocate the per symbol annotation struct, so do it at the symbol constructor instead of (ab)using the filter mechanism for that. This way we remove one of the few cases we have for that symbol filter, which will eventually led to removing it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-cvz34avlz1lez888lob95390@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-annotate.c')
-rw-r--r--tools/perf/builtin-annotate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 9c1034d81b4f..f07b23011b22 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -204,8 +204,6 @@ static int __cmd_annotate(struct perf_annotate *ann)
204 struct perf_evsel *pos; 204 struct perf_evsel *pos;
205 u64 total_nr_samples; 205 u64 total_nr_samples;
206 206
207 machines__set_symbol_filter(&session->machines, symbol__annotate_init);
208
209 if (ann->cpu_list) { 207 if (ann->cpu_list) {
210 ret = perf_session__cpu_bitmap(session, ann->cpu_list, 208 ret = perf_session__cpu_bitmap(session, ann->cpu_list,
211 ann->cpu_bitmap); 209 ann->cpu_bitmap);
@@ -367,7 +365,10 @@ int cmd_annotate(int argc, const char **argv, const char *prefix __maybe_unused)
367 if (annotate.session == NULL) 365 if (annotate.session == NULL)
368 return -1; 366 return -1;
369 367
370 symbol_conf.priv_size = sizeof(struct annotation); 368 ret = symbol__annotation_init();
369 if (ret < 0)
370 goto out_delete;
371
371 symbol_conf.try_vmlinux_path = true; 372 symbol_conf.try_vmlinux_path = true;
372 373
373 ret = symbol__init(&annotate.session->header.env); 374 ret = symbol__init(&annotate.session->header.env);