aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-05-29 19:49:14 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-29 19:52:38 -0400
commita44b45f236dd1c1a8caccf9a078adf2941a20267 (patch)
treedead7017e67403bdae20db5f2a3a409af9eea7d3 /tools
parent3780f4883b2f3319afe88bf3ddc73ef426851d49 (diff)
perf annotate browser: The idx_asm field should be used in asm only view
When hide_src_view is true we can't use browser_disasm_line->idx, that takes into account also non asm lines, we must use browser_disasm_line->idx_asm instead, otherwise we may end up with an index after the number of entries, oops, fix it. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> 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-o1szpyjh3z87yi0n6x0cr8uu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/ui/browsers/annotate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 6e0ef79be169..aaf36ce0b6fe 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -300,10 +300,14 @@ static void annotate_browser__set_rb_top(struct annotate_browser *browser,
300{ 300{
301 struct browser_disasm_line *bpos; 301 struct browser_disasm_line *bpos;
302 struct disasm_line *pos; 302 struct disasm_line *pos;
303 u32 idx;
303 304
304 bpos = rb_entry(nd, struct browser_disasm_line, rb_node); 305 bpos = rb_entry(nd, struct browser_disasm_line, rb_node);
305 pos = ((struct disasm_line *)bpos) - 1; 306 pos = ((struct disasm_line *)bpos) - 1;
306 annotate_browser__set_top(browser, pos, bpos->idx); 307 idx = bpos->idx;
308 if (browser->hide_src_code)
309 idx = bpos->idx_asm;
310 annotate_browser__set_top(browser, pos, idx);
307 browser->curr_hot = nd; 311 browser->curr_hot = nd;
308} 312}
309 313