perf annotate browser: Count the numbers of jump sources to a target
authorArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 12 May 2012 16:40:52 +0000 (13:40 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 12 May 2012 16:40:52 +0000 (13:40 -0300)
Instead of simply marking an offset as a jump target. So that we can
implement a new feature: showing "jumpy" targets, I.e. addresses that
lots of places jump to.

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-vc7b0u5yxgrubig0q61ayhxf@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/annotate.c

index 06367c1df72018d28c2db5c908deea960a8d1ddf..446362677840c6a3f572b517361aa56dc6372995 100644 (file)
@@ -16,7 +16,7 @@ struct browser_disasm_line {
        double          percent;
        u32             idx;
        int             idx_asm;
-       bool            jump_target;
+       int             jump_sources;
 };
 
 struct annotate_browser {
@@ -98,7 +98,7 @@ static void annotate_browser__write(struct ui_browser *self, void *entry, int ro
                if (!ab->use_offset) {
                        printed = scnprintf(bf, sizeof(bf), "%" PRIx64 ": ", addr);
                } else {
-                       if (bdl->jump_target) {
+                       if (bdl->jump_sources) {
                                printed = scnprintf(bf, sizeof(bf), "%*" PRIx64 ": ",
                                                    ab->addr_width, addr);
                        } else {
@@ -707,7 +707,7 @@ static void annotate_browser__mark_jump_targets(struct annotate_browser *browser
                        continue;
 
                bdlt = disasm_line__browser(dlt);
-               bdlt->jump_target = true;
+               ++bdlt->jump_sources;
        }
                
 }