aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2013-12-18 14:48:29 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-12-19 09:34:19 -0500
commit0f4e7a24d0303eaf12847b4fdf4f2d31553fdc61 (patch)
tree11b5f8dfe91cc636f81983ba7bcb91fb29a506c3
parent00e55218642b91c152917e170c8387c631467460 (diff)
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: 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-d728gz1orgkaknac9ppnzd9e@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-report.c11
-rw-r--r--tools/perf/util/annotate.c5
-rw-r--r--tools/perf/util/annotate.h3
3 files changed, 11 insertions, 8 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 0615a63ae355..9a20c9efb84b 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -127,8 +127,7 @@ static int perf_report__add_mem_hist_entry(struct perf_tool *tool,
127 goto out; 127 goto out;
128 128
129 mx = he->mem_info; 129 mx = he->mem_info;
130 err = symbol__inc_addr_samples(mx->daddr.sym, mx->daddr.map, 130 err = addr_map_symbol__inc_samples(&mx->daddr, evsel->idx);
131 evsel->idx, mx->daddr.al_addr);
132 if (err) 131 if (err)
133 goto out; 132 goto out;
134 133
@@ -190,15 +189,11 @@ static int perf_report__add_branch_hist_entry(struct perf_tool *tool,
190 1, 1, 0); 189 1, 1, 0);
191 if (he) { 190 if (he) {
192 bx = he->branch_info; 191 bx = he->branch_info;
193 err = symbol__inc_addr_samples(bx->from.sym, 192 err = addr_map_symbol__inc_samples(&bx->from, evsel->idx);
194 bx->from.map, evsel->idx,
195 bx->from.al_addr);
196 if (err) 193 if (err)
197 goto out; 194 goto out;
198 195
199 err = symbol__inc_addr_samples(bx->to.sym, 196 err = addr_map_symbol__inc_samples(&bx->to, evsel->idx);
200 bx->to.map, evsel->idx,
201 bx->to.al_addr);
202 if (err) 197 if (err)
203 goto out; 198 goto out;
204 199
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 93614cd3948f..2812e7b78d0f 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -503,6 +503,11 @@ int symbol__inc_addr_samples(struct symbol *sym, struct map *map,
503 return __symbol__inc_addr_samples(sym, map, notes, evidx, addr); 503 return __symbol__inc_addr_samples(sym, map, notes, evidx, addr);
504} 504}
505 505
506int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx)
507{
508 return symbol__inc_addr_samples(ams->sym, ams->map, evidx, ams->al_addr);
509}
510
506static void disasm_line__init_ins(struct disasm_line *dl) 511static void disasm_line__init_ins(struct disasm_line *dl)
507{ 512{
508 dl->ins = ins__find(dl->name); 513 dl->ins = ins__find(dl->name);
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 834b7b57b788..8de10b1ef027 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -134,6 +134,9 @@ static inline struct annotation *symbol__annotation(struct symbol *sym)
134 134
135int symbol__inc_addr_samples(struct symbol *sym, struct map *map, 135int symbol__inc_addr_samples(struct symbol *sym, struct map *map,
136 int evidx, u64 addr); 136 int evidx, u64 addr);
137
138int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx);
139
137int symbol__alloc_hist(struct symbol *sym); 140int symbol__alloc_hist(struct symbol *sym);
138void symbol__annotate_zero_histograms(struct symbol *sym); 141void symbol__annotate_zero_histograms(struct symbol *sym);
139 142