diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-12 15:28:18 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-13 09:00:05 -0400 |
| commit | b0d5c81e872ed21de1e56feb0fa6e4161da7be61 (patch) | |
| tree | a263d89f358b993c2f70fce7ce0f5ea79d451252 /tools | |
| parent | 43c4023152a9c5742948ac919e58ade127fa4e2e (diff) | |
perf annotate: Handle variables in 'sub', 'or' and many other instructions
Just like is done for 'mov' and others that can have as source or
targets variables resolved by objdump, to make them more compact:
- orb $0x4,0x224d71(%rip) # 226ca4 <_rtld_global+0xca4>
+ orb $0x4,_rtld_global+0xca4
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Martin Liška <mliska@suse.cz>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Thomas Richter <tmricht@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-efex7746id4w4wa03nqxvh3m@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/arch/x86/annotate/instructions.c | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/tools/perf/arch/x86/annotate/instructions.c b/tools/perf/arch/x86/annotate/instructions.c index 5bd1ba8c0282..44f5aba78210 100644 --- a/tools/perf/arch/x86/annotate/instructions.c +++ b/tools/perf/arch/x86/annotate/instructions.c | |||
| @@ -1,21 +1,43 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | static struct ins x86__instructions[] = { | 2 | static struct ins x86__instructions[] = { |
| 3 | { .name = "adc", .ops = &mov_ops, }, | ||
| 4 | { .name = "adcb", .ops = &mov_ops, }, | ||
| 5 | { .name = "adcl", .ops = &mov_ops, }, | ||
| 3 | { .name = "add", .ops = &mov_ops, }, | 6 | { .name = "add", .ops = &mov_ops, }, |
| 4 | { .name = "addl", .ops = &mov_ops, }, | 7 | { .name = "addl", .ops = &mov_ops, }, |
| 5 | { .name = "addq", .ops = &mov_ops, }, | 8 | { .name = "addq", .ops = &mov_ops, }, |
| 9 | { .name = "addsd", .ops = &mov_ops, }, | ||
| 6 | { .name = "addw", .ops = &mov_ops, }, | 10 | { .name = "addw", .ops = &mov_ops, }, |
| 7 | { .name = "and", .ops = &mov_ops, }, | 11 | { .name = "and", .ops = &mov_ops, }, |
| 12 | { .name = "andb", .ops = &mov_ops, }, | ||
| 13 | { .name = "andl", .ops = &mov_ops, }, | ||
| 14 | { .name = "andpd", .ops = &mov_ops, }, | ||
| 15 | { .name = "andps", .ops = &mov_ops, }, | ||
| 16 | { .name = "andq", .ops = &mov_ops, }, | ||
| 17 | { .name = "andw", .ops = &mov_ops, }, | ||
| 18 | { .name = "bsr", .ops = &mov_ops, }, | ||
| 19 | { .name = "bt", .ops = &mov_ops, }, | ||
| 20 | { .name = "btr", .ops = &mov_ops, }, | ||
| 8 | { .name = "bts", .ops = &mov_ops, }, | 21 | { .name = "bts", .ops = &mov_ops, }, |
| 22 | { .name = "btsq", .ops = &mov_ops, }, | ||
| 9 | { .name = "call", .ops = &call_ops, }, | 23 | { .name = "call", .ops = &call_ops, }, |
| 10 | { .name = "callq", .ops = &call_ops, }, | 24 | { .name = "callq", .ops = &call_ops, }, |
| 25 | { .name = "cmovbe", .ops = &mov_ops, }, | ||
| 26 | { .name = "cmove", .ops = &mov_ops, }, | ||
| 27 | { .name = "cmovae", .ops = &mov_ops, }, | ||
| 11 | { .name = "cmp", .ops = &mov_ops, }, | 28 | { .name = "cmp", .ops = &mov_ops, }, |
| 12 | { .name = "cmpb", .ops = &mov_ops, }, | 29 | { .name = "cmpb", .ops = &mov_ops, }, |
| 13 | { .name = "cmpl", .ops = &mov_ops, }, | 30 | { .name = "cmpl", .ops = &mov_ops, }, |
| 14 | { .name = "cmpq", .ops = &mov_ops, }, | 31 | { .name = "cmpq", .ops = &mov_ops, }, |
| 15 | { .name = "cmpw", .ops = &mov_ops, }, | 32 | { .name = "cmpw", .ops = &mov_ops, }, |
| 16 | { .name = "cmpxch", .ops = &mov_ops, }, | 33 | { .name = "cmpxch", .ops = &mov_ops, }, |
| 34 | { .name = "cmpxchg", .ops = &mov_ops, }, | ||
| 35 | { .name = "cs", .ops = &mov_ops, }, | ||
| 17 | { .name = "dec", .ops = &dec_ops, }, | 36 | { .name = "dec", .ops = &dec_ops, }, |
| 18 | { .name = "decl", .ops = &dec_ops, }, | 37 | { .name = "decl", .ops = &dec_ops, }, |
| 38 | { .name = "divsd", .ops = &mov_ops, }, | ||
| 39 | { .name = "divss", .ops = &mov_ops, }, | ||
| 40 | { .name = "gs", .ops = &mov_ops, }, | ||
| 19 | { .name = "imul", .ops = &mov_ops, }, | 41 | { .name = "imul", .ops = &mov_ops, }, |
| 20 | { .name = "inc", .ops = &dec_ops, }, | 42 | { .name = "inc", .ops = &dec_ops, }, |
| 21 | { .name = "incl", .ops = &dec_ops, }, | 43 | { .name = "incl", .ops = &dec_ops, }, |
| @@ -57,25 +79,68 @@ static struct ins x86__instructions[] = { | |||
| 57 | { .name = "lea", .ops = &mov_ops, }, | 79 | { .name = "lea", .ops = &mov_ops, }, |
| 58 | { .name = "lock", .ops = &lock_ops, }, | 80 | { .name = "lock", .ops = &lock_ops, }, |
| 59 | { .name = "mov", .ops = &mov_ops, }, | 81 | { .name = "mov", .ops = &mov_ops, }, |
| 82 | { .name = "movapd", .ops = &mov_ops, }, | ||
| 83 | { .name = "movaps", .ops = &mov_ops, }, | ||
| 60 | { .name = "movb", .ops = &mov_ops, }, | 84 | { .name = "movb", .ops = &mov_ops, }, |
| 61 | { .name = "movdqa", .ops = &mov_ops, }, | 85 | { .name = "movdqa", .ops = &mov_ops, }, |
| 86 | { .name = "movdqu", .ops = &mov_ops, }, | ||
| 62 | { .name = "movl", .ops = &mov_ops, }, | 87 | { .name = "movl", .ops = &mov_ops, }, |
| 63 | { .name = "movq", .ops = &mov_ops, }, | 88 | { .name = "movq", .ops = &mov_ops, }, |
| 89 | { .name = "movsd", .ops = &mov_ops, }, | ||
| 64 | { .name = "movslq", .ops = &mov_ops, }, | 90 | { .name = "movslq", .ops = &mov_ops, }, |
| 91 | { .name = "movss", .ops = &mov_ops, }, | ||
| 92 | { .name = "movupd", .ops = &mov_ops, }, | ||
| 93 | { .name = "movups", .ops = &mov_ops, }, | ||
| 94 | { .name = "movw", .ops = &mov_ops, }, | ||
| 65 | { .name = "movzbl", .ops = &mov_ops, }, | 95 | { .name = "movzbl", .ops = &mov_ops, }, |
| 66 | { .name = "movzwl", .ops = &mov_ops, }, | 96 | { .name = "movzwl", .ops = &mov_ops, }, |
| 97 | { .name = "mulsd", .ops = &mov_ops, }, | ||
| 98 | { .name = "mulss", .ops = &mov_ops, }, | ||
| 67 | { .name = "nop", .ops = &nop_ops, }, | 99 | { .name = "nop", .ops = &nop_ops, }, |
| 68 | { .name = "nopl", .ops = &nop_ops, }, | 100 | { .name = "nopl", .ops = &nop_ops, }, |
| 69 | { .name = "nopw", .ops = &nop_ops, }, | 101 | { .name = "nopw", .ops = &nop_ops, }, |
| 70 | { .name = "or", .ops = &mov_ops, }, | 102 | { .name = "or", .ops = &mov_ops, }, |
| 103 | { .name = "orb", .ops = &mov_ops, }, | ||
| 71 | { .name = "orl", .ops = &mov_ops, }, | 104 | { .name = "orl", .ops = &mov_ops, }, |
| 105 | { .name = "orps", .ops = &mov_ops, }, | ||
| 106 | { .name = "orq", .ops = &mov_ops, }, | ||
| 107 | { .name = "pand", .ops = &mov_ops, }, | ||
| 108 | { .name = "paddq", .ops = &mov_ops, }, | ||
| 109 | { .name = "pcmpeqb", .ops = &mov_ops, }, | ||
| 110 | { .name = "por", .ops = &mov_ops, }, | ||
| 111 | { .name = "rclb", .ops = &mov_ops, }, | ||
| 112 | { .name = "rcll", .ops = &mov_ops, }, | ||
| 113 | { .name = "retq", .ops = &ret_ops, }, | ||
| 114 | { .name = "sbb", .ops = &mov_ops, }, | ||
| 115 | { .name = "sbbl", .ops = &mov_ops, }, | ||
| 116 | { .name = "sete", .ops = &mov_ops, }, | ||
| 117 | { .name = "sub", .ops = &mov_ops, }, | ||
| 118 | { .name = "subl", .ops = &mov_ops, }, | ||
| 119 | { .name = "subq", .ops = &mov_ops, }, | ||
| 120 | { .name = "subsd", .ops = &mov_ops, }, | ||
| 121 | { .name = "subw", .ops = &mov_ops, }, | ||
| 72 | { .name = "test", .ops = &mov_ops, }, | 122 | { .name = "test", .ops = &mov_ops, }, |
| 73 | { .name = "testb", .ops = &mov_ops, }, | 123 | { .name = "testb", .ops = &mov_ops, }, |
| 74 | { .name = "testl", .ops = &mov_ops, }, | 124 | { .name = "testl", .ops = &mov_ops, }, |
| 125 | { .name = "ucomisd", .ops = &mov_ops, }, | ||
| 126 | { .name = "ucomiss", .ops = &mov_ops, }, | ||
| 127 | { .name = "vaddsd", .ops = &mov_ops, }, | ||
| 128 | { .name = "vandpd", .ops = &mov_ops, }, | ||
| 129 | { .name = "vmovdqa", .ops = &mov_ops, }, | ||
| 130 | { .name = "vmovq", .ops = &mov_ops, }, | ||
| 131 | { .name = "vmovsd", .ops = &mov_ops, }, | ||
| 132 | { .name = "vmulsd", .ops = &mov_ops, }, | ||
| 133 | { .name = "vorpd", .ops = &mov_ops, }, | ||
| 134 | { .name = "vsubsd", .ops = &mov_ops, }, | ||
| 135 | { .name = "vucomisd", .ops = &mov_ops, }, | ||
| 75 | { .name = "xadd", .ops = &mov_ops, }, | 136 | { .name = "xadd", .ops = &mov_ops, }, |
| 76 | { .name = "xbeginl", .ops = &jump_ops, }, | 137 | { .name = "xbeginl", .ops = &jump_ops, }, |
| 77 | { .name = "xbeginq", .ops = &jump_ops, }, | 138 | { .name = "xbeginq", .ops = &jump_ops, }, |
| 78 | { .name = "retq", .ops = &ret_ops, }, | 139 | { .name = "xchg", .ops = &mov_ops, }, |
| 140 | { .name = "xor", .ops = &mov_ops, }, | ||
| 141 | { .name = "xorb", .ops = &mov_ops, }, | ||
| 142 | { .name = "xorpd", .ops = &mov_ops, }, | ||
| 143 | { .name = "xorps", .ops = &mov_ops, }, | ||
| 79 | }; | 144 | }; |
| 80 | 145 | ||
| 81 | static bool x86__ins_is_fused(struct arch *arch, const char *ins1, | 146 | static bool x86__ins_is_fused(struct arch *arch, const char *ins1, |
