diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-04-18 16:07:38 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-04-18 16:07:38 -0300 |
commit | d86b0597c4bd41ea3edc6446a855306eed34f93b (patch) | |
tree | a2363453f0073ccaf7defddde7ac703a2a71bbd9 /tools/perf/ui | |
parent | 4f9d03251b9d202ebce805757360ef0fac5eb74e (diff) |
perf annotate: Parse call targets earlier
No need to do it everytime the user presses enter/-> on a call
instruction.
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-ybgss44m5ycry8mk7b1qdbre@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.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index bdbb54fd05ae..46ef966ccc5b 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -266,11 +266,10 @@ static bool annotate_browser__callq(struct annotate_browser *browser, struct symbol *target; u64 ip; - if (strcmp(dl->name, "callq")) + if (!ins__is_call(dl->ins)) return false; - ip = strtoull(dl->operands, NULL, 16); - ip = ms->map->map_ip(ms->map, ip); + ip = ms->map->map_ip(ms->map, dl->target); target = map__find_symbol(ms->map, ip, NULL); if (target == NULL) { ui_helpline__puts("The called function was not found."); @@ -318,7 +317,7 @@ static bool annotate_browser__jump(struct annotate_browser *browser) struct disasm_line *dl = browser->selection; s64 idx; - if (!dl->ins || !ins__is_jump(dl->ins)) + if (!ins__is_jump(dl->ins)) return false; dl = annotate_browser__find_offset(browser, dl->target, &idx); @@ -556,7 +555,8 @@ show_help: ui_helpline__puts("Huh? No selection. Report to linux-kernel@vger.kernel.org"); else if (self->selection->offset == -1) ui_helpline__puts("Actions are only available for assembly lines."); - else if (!(annotate_browser__jump(self) || + else if (!self->selection->ins || + !(annotate_browser__jump(self) || annotate_browser__callq(self, evidx, timer, arg, delay_secs))) ui_helpline__puts("Actions are only available for the 'callq' and jump instructions."); continue; |