diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-25 13:56:34 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-25 13:56:34 -0500 |
commit | 5252b1aeabd0ae794cfaf323c10968443f10a363 (patch) | |
tree | a7a990c8899b0da5e601b26a9e9991c9043f22bb /tools/perf/ui/browsers/annotate.c | |
parent | 9484b86e9cad903d3295d75c03961c3bdd1444a8 (diff) |
perf annotate: Show invalid jump offset in error message
To help in debugging when the wrong offset is being used, like in:
│13d98: ↓ jne 13dd1 <lzma_lzma_preset@@XZ_5.0+0x28e1>
That is the full line from objdump, and it seems what should be used is
13dd1, not 28e1.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-4nc0marsgst1ft6inmvqber7@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index cee0eee31ce6..ec7a30fad149 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -543,14 +543,16 @@ struct disasm_line *annotate_browser__find_offset(struct annotate_browser *brows | |||
543 | static bool annotate_browser__jump(struct annotate_browser *browser) | 543 | static bool annotate_browser__jump(struct annotate_browser *browser) |
544 | { | 544 | { |
545 | struct disasm_line *dl = browser->selection; | 545 | struct disasm_line *dl = browser->selection; |
546 | u64 offset; | ||
546 | s64 idx; | 547 | s64 idx; |
547 | 548 | ||
548 | if (!ins__is_jump(&dl->ins)) | 549 | if (!ins__is_jump(&dl->ins)) |
549 | return false; | 550 | return false; |
550 | 551 | ||
551 | dl = annotate_browser__find_offset(browser, dl->ops.target.offset, &idx); | 552 | offset = dl->ops.target.offset; |
553 | dl = annotate_browser__find_offset(browser, offset, &idx); | ||
552 | if (dl == NULL) { | 554 | if (dl == NULL) { |
553 | ui_helpline__puts("Invalid jump offset"); | 555 | ui_helpline__printf("Invalid jump offset: %" PRIx64, offset); |
554 | return true; | 556 | return true; |
555 | } | 557 | } |
556 | 558 | ||