diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-18 15:37:41 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-19 11:33:51 -0300 |
commit | b66d8c0caa8f7925ae75fed243b0482a901f21e1 (patch) | |
tree | c16e7257c612d54a6ff7af9c29ef627884d984a1 /tools/perf/builtin-report.c | |
parent | bf19b82e7cf033319525a9eab12216b59c41c519 (diff) | |
download | op-kernel-dev-b66d8c0caa8f7925ae75fed243b0482a901f21e1.zip op-kernel-dev-b66d8c0caa8f7925ae75fed243b0482a901f21e1.tar.gz |
perf annotate: Auto allocate symbol per addr hist buckets
Instead of open coding it in multiple places in 'report' and 'top'.
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-ay1ushp57qsva9aw59rha5ve@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 59 |
1 files changed, 16 insertions, 43 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 3a14dbe..b75fc36 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -140,22 +140,11 @@ static int perf_report__add_mem_hist_entry(struct perf_tool *tool, goto out; } - if (sort__has_sym && he->mem_info->daddr.sym && use_browser > 0) { - struct annotation *notes; - - mx = he->mem_info; - - notes = symbol__annotation(mx->daddr.sym); - if (notes->src == NULL && symbol__alloc_hist(mx->daddr.sym) < 0) - goto out; - - err = symbol__inc_addr_samples(mx->daddr.sym, - mx->daddr.map, - evsel->idx, - mx->daddr.al_addr); - if (err) - goto out; - } + mx = he->mem_info; + err = symbol__inc_addr_samples(mx->daddr.sym, mx->daddr.map, + evsel->idx, mx->daddr.al_addr); + if (err) + goto out; evsel->hists.stats.total_period += cost; hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); @@ -214,35 +203,19 @@ static int perf_report__add_branch_hist_entry(struct perf_tool *tool, he = __hists__add_entry(&evsel->hists, al, parent, &bi[i], NULL, 1, 1, 0); if (he) { - struct annotation *notes; bx = he->branch_info; - if (bx->from.sym && use_browser == 1 && sort__has_sym) { - notes = symbol__annotation(bx->from.sym); - if (!notes->src - && symbol__alloc_hist(bx->from.sym) < 0) - goto out; - - err = symbol__inc_addr_samples(bx->from.sym, - bx->from.map, - evsel->idx, - bx->from.al_addr); - if (err) - goto out; - } + err = symbol__inc_addr_samples(bx->from.sym, + bx->from.map, evsel->idx, + bx->from.al_addr); + if (err) + goto out; + + err = symbol__inc_addr_samples(bx->to.sym, + bx->to.map, evsel->idx, + bx->to.al_addr); + if (err) + goto out; - if (bx->to.sym && use_browser == 1 && sort__has_sym) { - notes = symbol__annotation(bx->to.sym); - if (!notes->src - && symbol__alloc_hist(bx->to.sym) < 0) - goto out; - - err = symbol__inc_addr_samples(bx->to.sym, - bx->to.map, - evsel->idx, - bx->to.al_addr); - if (err) - goto out; - } evsel->hists.stats.total_period += 1; hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); } else |