Skip to content

Commit

Permalink
perf annotate browser: Don't draw jump connectors for out of function…
Browse files Browse the repository at this point in the history
… jumps

As described in the previous patch. Next step is to properly label those
jumps by using a -> arrow, i.e. not backwards/forwards, and allow the
user to navigate to this other function when enter or -> is pressed.

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-ax2sss463eu88wgl9ee8a6b6@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Arnaldo Carvalho de Melo committed Apr 25, 2012
1 parent fb29fa5 commit 38b31bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/perf/ui/browsers/annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ static void annotate_browser__draw_current_loop(struct ui_browser *browser)
unsigned int from, to, start_width = 2;

list_for_each_entry_from(pos, &notes->src->source, node) {
if (!pos->ins || !ins__is_jump(pos->ins))
if (!pos->ins || !ins__is_jump(pos->ins) ||
!disasm_line__has_offset(pos))
continue;

target = ab->offsets[pos->ops.target.offset];
Expand Down Expand Up @@ -689,7 +690,8 @@ static void annotate_browser__mark_jump_targets(struct annotate_browser *browser
struct disasm_line *dl = browser->offsets[offset], *dlt;
struct browser_disasm_line *bdlt;

if (!dl || !dl->ins || !ins__is_jump(dl->ins))
if (!dl || !dl->ins || !ins__is_jump(dl->ins) ||
!disasm_line__has_offset(dl))
continue;

if (dl->ops.target.offset >= size) {
Expand Down

0 comments on commit 38b31bd

Please sign in to comment.