diff options
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/annotate.c | 18 | ||||
-rw-r--r-- | tools/perf/util/annotate.h | 1 |
2 files changed, 18 insertions, 1 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 4ee2c07924bc..a4296fdd9a68 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -18,6 +18,21 @@ | |||
18 | 18 | ||
19 | const char *disassembler_style; | 19 | const char *disassembler_style; |
20 | 20 | ||
21 | static int call_ops__parse_target(const char *operands, u64 *target) | ||
22 | { | ||
23 | *target = strtoull(operands, NULL, 16); | ||
24 | return 0; | ||
25 | } | ||
26 | |||
27 | static struct ins_ops call_ops = { | ||
28 | .parse_target = call_ops__parse_target, | ||
29 | }; | ||
30 | |||
31 | bool ins__is_call(const struct ins *ins) | ||
32 | { | ||
33 | return ins->ops == &call_ops; | ||
34 | } | ||
35 | |||
21 | static int jump_ops__parse_target(const char *operands, u64 *target) | 36 | static int jump_ops__parse_target(const char *operands, u64 *target) |
22 | { | 37 | { |
23 | const char *s = strchr(operands, '+'); | 38 | const char *s = strchr(operands, '+'); |
@@ -38,11 +53,12 @@ bool ins__is_jump(const struct ins *ins) | |||
38 | return ins->ops == &jump_ops; | 53 | return ins->ops == &jump_ops; |
39 | } | 54 | } |
40 | 55 | ||
41 | |||
42 | /* | 56 | /* |
43 | * Must be sorted by name! | 57 | * Must be sorted by name! |
44 | */ | 58 | */ |
45 | static struct ins instructions[] = { | 59 | static struct ins instructions[] = { |
60 | { .name = "call", .ops = &call_ops, }, | ||
61 | { .name = "callq", .ops = &call_ops, }, | ||
46 | { .name = "ja", .ops = &jump_ops, }, | 62 | { .name = "ja", .ops = &jump_ops, }, |
47 | { .name = "je", .ops = &jump_ops, }, | 63 | { .name = "je", .ops = &jump_ops, }, |
48 | { .name = "jmp", .ops = &jump_ops, }, | 64 | { .name = "jmp", .ops = &jump_ops, }, |
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 934c6fe3a91b..a2105f204a42 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h | |||
@@ -17,6 +17,7 @@ struct ins { | |||
17 | }; | 17 | }; |
18 | 18 | ||
19 | bool ins__is_jump(const struct ins *ins); | 19 | bool ins__is_jump(const struct ins *ins); |
20 | bool ins__is_call(const struct ins *ins); | ||
20 | 21 | ||
21 | struct disasm_line { | 22 | struct disasm_line { |
22 | struct list_head node; | 23 | struct list_head node; |