Skip to content

Commit

Permalink
perf annotate browser: The idx_asm field should be used in asm only view
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed May 29, 2012
1 parent 3780f48 commit a44b45f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/perf/ui/browsers/annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,14 @@ static void annotate_browser__set_rb_top(struct annotate_browser *browser,
{
struct browser_disasm_line *bpos;
struct disasm_line *pos;
u32 idx;

bpos = rb_entry(nd, struct browser_disasm_line, rb_node);
pos = ((struct disasm_line *)bpos) - 1;
annotate_browser__set_top(browser, pos, bpos->idx);
idx = bpos->idx;
if (browser->hide_src_code)
idx = bpos->idx_asm;
annotate_browser__set_top(browser, pos, idx);
browser->curr_hot = nd;
}

Expand Down

0 comments on commit a44b45f

Please sign in to comment.