aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-04-25 06:48:42 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-04-25 06:48:42 -0400
commit9481ede909e08418c9379665ee9f25335d20dd06 (patch)
tree3ba179a87c59ed08490263b7c93fe0f1f1a50dec /tools/perf/ui
parenta3f895be1f1ed17f66e6e71adeef0cc7f937512c (diff)
perf annotate browser: Handle NULL jump targets
In annotate_browser__mark_jump_targets 702 dlt = browser->offsets[dl->ops.target]; 703 bdlt = disasm_line__browser(dlt); 704 bdlt->jump_target = true; 705 } 706 707 } (gdb) p size $5 = 2415 (gdb) p offset $6 = 140 (gdb) p dl->ops.target $7 = 143 (gdb) p browser->offsets[143] $8 = (struct disasm_line *) 0x0 (gdb) p dl->name $9 = 0x2363bd0 "je" (gdb) Really strange, the code assumed that at the jump target we would have an assembly line, but only in the previous instruction offset we have a 'lock': (gdb) p browser->offsets[144] $10 = (struct disasm_line *) 0x0 (gdb) p browser->offsets[142] $11 = (struct disasm_line *) 0x27bd620 (gdb) p browser->offsets[142]->name $12 = 0x237a8a0 "lock" (gdb) I'll study this more, but for now I'll just check if there is a disasm_line at dl->ops.target, i.e. a valid jump target. Reported-by: Hagen Paul Pfeifer <hagen@jauu.net> Reported-by: Ingo Molnar <mingo@kernel.org> 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-inzjrzyqhkzyv78met2vula6@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
-rw-r--r--tools/perf/ui/browsers/annotate.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index 9e3310cd02cd..4c83fe3d7dad 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -700,6 +700,13 @@ static void annotate_browser__mark_jump_targets(struct annotate_browser *browser
700 } 700 }
701 701
702 dlt = browser->offsets[dl->ops.target]; 702 dlt = browser->offsets[dl->ops.target];
703 /*
704 * FIXME: Oops, no jump target? Buggy disassembler? Or do we
705 * have to adjust to the previous offset?
706 */
707 if (dlt == NULL)
708 continue;
709
703 bdlt = disasm_line__browser(dlt); 710 bdlt = disasm_line__browser(dlt);
704 bdlt->jump_target = true; 711 bdlt->jump_target = true;
705 } 712 }