diff options
author | Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> | 2016-06-24 07:53:58 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-27 13:25:05 -0400 |
commit | 6ef9492915b09816c75bb41e7e37b2e507d2f70f (patch) | |
tree | 7dc66188a6168c9bcd799febdbe6ea9d7f923ba5 /tools/perf/util/annotate.c | |
parent | 9f776ba11c8be311a5c23777bc9f3b96498cc6cc (diff) |
perf annotate: Generalize handling of 'ret' instructions
Introduce helper to detect 'ret' instructions and use the same in the TUI.
A helper is needed since some architectures such as powerpc have more
than one return instruction.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Anton Blanchard <anton@ozlabs.org>
Cc: Daniel Axtens <dja@axtens.net>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Link: http://lkml.kernel.org/r/1466769240-12376-5-git-send-email-ravi.bangoria@linux.vnet.ibm.com
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.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index b2c7ae465465..c385fecb9d32 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -354,6 +354,15 @@ static struct ins_ops nop_ops = { | |||
354 | .scnprintf = nop__scnprintf, | 354 | .scnprintf = nop__scnprintf, |
355 | }; | 355 | }; |
356 | 356 | ||
357 | static struct ins_ops ret_ops = { | ||
358 | .scnprintf = ins__raw_scnprintf, | ||
359 | }; | ||
360 | |||
361 | bool ins__is_ret(const struct ins *ins) | ||
362 | { | ||
363 | return ins->ops == &ret_ops; | ||
364 | } | ||
365 | |||
357 | static struct ins instructions[] = { | 366 | static struct ins instructions[] = { |
358 | { .name = "add", .ops = &mov_ops, }, | 367 | { .name = "add", .ops = &mov_ops, }, |
359 | { .name = "addl", .ops = &mov_ops, }, | 368 | { .name = "addl", .ops = &mov_ops, }, |
@@ -444,6 +453,7 @@ static struct ins instructions[] = { | |||
444 | { .name = "xadd", .ops = &mov_ops, }, | 453 | { .name = "xadd", .ops = &mov_ops, }, |
445 | { .name = "xbeginl", .ops = &jump_ops, }, | 454 | { .name = "xbeginl", .ops = &jump_ops, }, |
446 | { .name = "xbeginq", .ops = &jump_ops, }, | 455 | { .name = "xbeginq", .ops = &jump_ops, }, |
456 | { .name = "retq", .ops = &ret_ops, }, | ||
447 | }; | 457 | }; |
448 | 458 | ||
449 | static int ins__key_cmp(const void *name, const void *insp) | 459 | static int ins__key_cmp(const void *name, const void *insp) |