Skip to content

Commit

Permalink
perf annotate: Show invalid jump offset in error message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnaldo Carvalho de Melo committed Nov 25, 2016
1 parent 9484b86 commit 5252b1a
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 @@ -543,14 +543,16 @@ struct disasm_line *annotate_browser__find_offset(struct annotate_browser *brows
static bool annotate_browser__jump(struct annotate_browser *browser)
{
struct disasm_line *dl = browser->selection;
u64 offset;
s64 idx;

if (!ins__is_jump(&dl->ins))
return false;

dl = annotate_browser__find_offset(browser, dl->ops.target.offset, &idx);
offset = dl->ops.target.offset;
dl = annotate_browser__find_offset(browser, offset, &idx);
if (dl == NULL) {
ui_helpline__puts("Invalid jump offset");
ui_helpline__printf("Invalid jump offset: %" PRIx64, offset);
return true;
}

Expand Down

0 comments on commit 5252b1a

Please sign in to comment.