perf annotate browser: Don't draw jump connectors for out of function jumps
authorArnaldo Carvalho de Melo <[email protected]>
Wed, 25 Apr 2012 17:18:42 +0000 (14:18 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 25 Apr 2012 17:18:42 +0000 (14:18 -0300)
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 <[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]>
tools/perf/ui/browsers/annotate.c

index 73e1ef0081d48bff05a386079e6b511a50d9040f..077380baa1c071abcee202db947c304026dbb4cf 100644 (file)
@@ -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];
@@ -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) {