diff options
Diffstat (limited to 'tools/perf/ui')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 0bc3e652b54..bdbb54fd05a 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -315,26 +315,13 @@ struct disasm_line *annotate_browser__find_offset(struct annotate_browser *brows static bool annotate_browser__jump(struct annotate_browser *browser) { - const char *jumps[] = { "je", "jne", "ja", "jmpq", "js", "jmp", NULL }; struct disasm_line *dl = browser->selection; - s64 idx, offset; - char *s; - int i = 0; - - while (jumps[i] && strcmp(dl->name, jumps[i])) - ++i; + s64 idx; - if (jumps[i] == NULL) + if (!dl->ins || !ins__is_jump(dl->ins)) return false; - s = strchr(dl->operands, '+'); - if (s++ == NULL) { - ui_helpline__puts("Invallid jump instruction."); - return true; - } - - offset = strtoll(s, NULL, 16); - dl = annotate_browser__find_offset(browser, offset, &idx); + dl = annotate_browser__find_offset(browser, dl->target, &idx); if (dl == NULL) { ui_helpline__puts("Invallid jump offset"); return true; |