perf annotate: Add inc_samples method to addr_map_symbol

Since there are three calls that could receive just the struct
addr_map_symbol pointer and call the symbol method.
Acked-by: default avatarNamhyung 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-d728gz1orgkaknac9ppnzd9e@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 00e55218
...@@ -127,8 +127,7 @@ static int perf_report__add_mem_hist_entry(struct perf_tool *tool, ...@@ -127,8 +127,7 @@ static int perf_report__add_mem_hist_entry(struct perf_tool *tool,
goto out; goto out;
mx = he->mem_info; mx = he->mem_info;
err = symbol__inc_addr_samples(mx->daddr.sym, mx->daddr.map, err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx);
evsel->idx, mx->daddr.al_addr);
if (err) if (err)
goto out; goto out;
...@@ -190,15 +189,11 @@ static int perf_report__add_branch_hist_entry(struct perf_tool *tool, ...@@ -190,15 +189,11 @@ static int perf_report__add_branch_hist_entry(struct perf_tool *tool,
1, 1, 0); 1, 1, 0);
if (he) { if (he) {
bx = he->branch_info; bx = he->branch_info;
err = symbol__inc_addr_samples(bx->from.sym, err = addr_map_symbol__inc_samples(&bx->from, evsel->idx);
bx->from.map, evsel->idx,
bx->from.al_addr);
if (err) if (err)
goto out; goto out;
err = symbol__inc_addr_samples(bx->to.sym, err = addr_map_symbol__inc_samples(&bx->to, evsel->idx);
bx->to.map, evsel->idx,
bx->to.al_addr);
if (err) if (err)
goto out; goto out;
......
...@@ -503,6 +503,11 @@ int symbol__inc_addr_samples(struct symbol *sym, struct map *map, ...@@ -503,6 +503,11 @@ int symbol__inc_addr_samples(struct symbol *sym, struct map *map,
return __symbol__inc_addr_samples(sym, map, notes, evidx, addr); return __symbol__inc_addr_samples(sym, map, notes, evidx, addr);
} }
int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx)
{
return symbol__inc_addr_samples(ams->sym, ams->map, evidx, ams->al_addr);
}
static void disasm_line__init_ins(struct disasm_line *dl) static void disasm_line__init_ins(struct disasm_line *dl)
{ {
dl->ins = ins__find(dl->name); dl->ins = ins__find(dl->name);
......
...@@ -134,6 +134,9 @@ static inline struct annotation *symbol__annotation(struct symbol *sym) ...@@ -134,6 +134,9 @@ static inline struct annotation *symbol__annotation(struct symbol *sym)
int symbol__inc_addr_samples(struct symbol *sym, struct map *map, int symbol__inc_addr_samples(struct symbol *sym, struct map *map,
int evidx, u64 addr); int evidx, u64 addr);
int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx);
int symbol__alloc_hist(struct symbol *sym); int symbol__alloc_hist(struct symbol *sym);
void symbol__annotate_zero_histograms(struct symbol *sym); void symbol__annotate_zero_histograms(struct symbol *sym);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment