aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-05-11 11:28:55 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-11 11:28:55 -0400
commite8ea1561952b04276cf4c02500e363de76c142aa (patch)
treeb60503e278984acfefad56b391a027f8454a7e27 /tools/perf/util/annotate.c
parent5dcefda0fd87fefa440abc9b9d3f1089229f8911 (diff)
perf annotate: Use raw form for register indirect call instructions
callq *0x10(%rax) was being rendered in simplified mode as: callq *10 I.e. hexa, but without the 0x and omitting the register. In such cases just use the raw form. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> 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-m91tv004h2m1fkfgu6ovx3hb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 6b4146b40a20..9a020d1e0180 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -56,6 +56,12 @@ static int call__parse(struct ins_operands *ops)
56 return ops->target.name == NULL ? -1 : 0; 56 return ops->target.name == NULL ? -1 : 0;
57 57
58indirect_call: 58indirect_call:
59 tok = strchr(endptr, '(');
60 if (tok != NULL) {
61 ops->target.addr = 0;
62 return 0;
63 }
64
59 tok = strchr(endptr, '*'); 65 tok = strchr(endptr, '*');
60 if (tok == NULL) 66 if (tok == NULL)
61 return -1; 67 return -1;
@@ -70,6 +76,9 @@ static int call__scnprintf(struct ins *ins, char *bf, size_t size,
70 if (ops->target.name) 76 if (ops->target.name)
71 return scnprintf(bf, size, "%-6.6s %s", ins->name, ops->target.name); 77 return scnprintf(bf, size, "%-6.6s %s", ins->name, ops->target.name);
72 78
79 if (ops->target.addr == 0)
80 return ins__raw_scnprintf(ins, bf, size, ops);
81
73 return scnprintf(bf, size, "%-6.6s *%" PRIx64, ins->name, ops->target.addr); 82 return scnprintf(bf, size, "%-6.6s *%" PRIx64, ins->name, ops->target.addr);
74} 83}
75 84