summaryrefslogtreecommitdiffstats
path: root/tools/perf/ui
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-04-18 13:58:34 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-04-18 13:58:34 -0300
commit4f9d03251b9d202ebce805757360ef0fac5eb74e (patch)
tree828b5d690bcd1bb1b04a98d7c735a54545cc589e /tools/perf/ui
parent657bcaf5097e1aff53d724358deb24ce803f43a4 (diff)
perf annotate: Disassembler instruction parsing
So that at disassembly time we parse targets, etc. Supporting jump instructions initially, call functions are next. 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-7vzlh66n5or46n27ji658cnl@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.c19
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;