aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-03-20 10:03:30 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-03-21 11:53:43 -0400
commit425859ff0de33a2362bec2a2c7ca486f87c13100 (patch)
tree1ef9871404ea23cb97deef2e5370f4a119b8f9c3
parentd9bd766584491dbb6f96c85a27562eb1289b2ca9 (diff)
perf annotate: No need to calculate notes->start twice
Since we already set notes->start to map__rip_2objdump(map, sym->start) in symbol__annotate2(), no need to calculate that address again in symbol__calc_lines(), just use notes->start. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-ycxlg8mm5ueuj21w6gi62l7g@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/annotate.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index a7111871440e..666f62c58e1a 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -2230,7 +2230,7 @@ void annotation__update_column_widths(struct annotation *notes)
2230} 2230}
2231 2231
2232static void annotation__calc_lines(struct annotation *notes, struct map *map, 2232static void annotation__calc_lines(struct annotation *notes, struct map *map,
2233 struct rb_root *root, u64 start) 2233 struct rb_root *root)
2234{ 2234{
2235 struct annotation_line *al; 2235 struct annotation_line *al;
2236 struct rb_root tmp_root = RB_ROOT; 2236 struct rb_root tmp_root = RB_ROOT;
@@ -2251,8 +2251,8 @@ static void annotation__calc_lines(struct annotation *notes, struct map *map,
2251 if (percent_max <= 0.5) 2251 if (percent_max <= 0.5)
2252 continue; 2252 continue;
2253 2253
2254 al->path = get_srcline(map->dso, start + al->offset, NULL, 2254 al->path = get_srcline(map->dso, notes->start + al->offset, NULL,
2255 false, true, start + al->offset); 2255 false, true, notes->start + al->offset);
2256 insert_source_line(&tmp_root, al); 2256 insert_source_line(&tmp_root, al);
2257 } 2257 }
2258 2258
@@ -2263,9 +2263,8 @@ static void symbol__calc_lines(struct symbol *sym, struct map *map,
2263 struct rb_root *root) 2263 struct rb_root *root)
2264{ 2264{
2265 struct annotation *notes = symbol__annotation(sym); 2265 struct annotation *notes = symbol__annotation(sym);
2266 u64 start = map__rip_2objdump(map, sym->start);
2267 2266
2268 annotation__calc_lines(notes, map, root, start); 2267 annotation__calc_lines(notes, map, root);
2269} 2268}
2270 2269
2271int symbol__tty_annotate2(struct symbol *sym, struct map *map, 2270int symbol__tty_annotate2(struct symbol *sym, struct map *map,