1 ## This test makes sure we can extract the instrumentation map from an
2 ## XRay-instrumented PIE file.
4 ## Generated from the following source:
5 ## __attribute__((xray_always_instrument)) void foo() {}
6 ## __attribute__((xray_always_instrument)) void bar() {}
7 ## __attribute__((xray_always_instrument)) void jar() {}
8 ## Built with the following arguments:
9 ## -target armv7a-linux-androideabi -nostdlib -fxray-instrument -fPIC -shared
17 Flags: [ EF_ARM_SOFT_FLOAT, EF_ARM_EABI_VER5 ]
18 Entry: 0x00000000000012B0
24 Align: 0x0000000000001000
29 VAddr: 0x00000000000012B0
30 Align: 0x0000000000001000
33 FirstSec: xray_instr_map
35 VAddr: 0x00000000000033CC
36 Align: 0x0000000000001000
41 Address: 0x0000000000000200
43 AddressAlign: 0x0000000000000004
45 - Offset: 0x00000000000033CC
47 - Offset: 0x00000000000033DC
49 - Offset: 0x00000000000033EC
51 - Offset: 0x00000000000033FC
53 - Offset: 0x000000000000340C
55 - Offset: 0x000000000000341C
57 - Offset: 0x0000000000003430
59 - Offset: 0x0000000000003434
61 - Offset: 0x0000000000003438
63 - Offset: 0x000000000000343C
65 - Offset: 0x0000000000003440
67 - Offset: 0x0000000000003444
69 - Offset: 0x00000000000033F0
72 - Offset: 0x0000000000003400
75 - Offset: 0x00000000000033D0
78 - Offset: 0x00000000000033E0
81 - Offset: 0x0000000000003410
84 - Offset: 0x0000000000003420
89 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
90 Address: 0x00000000000012B0
91 AddressAlign: 0x0000000000000004
93 - Name: xray_instr_map
95 Flags: [ SHF_WRITE, SHF_ALLOC, SHF_LINK_ORDER ]
96 Address: 0x00000000000033CC
98 AddressAlign: 0x0000000000000001
99 Content: B0120000000000000001000000000000CC120000000000000101000000000000EC120000000000000001000000000000081300000000000001010000000000002813000000000000000100000000000044130000000000000101000000000000
102 Flags: [ SHF_WRITE, SHF_ALLOC, SHF_LINK_ORDER ]
103 Address: 0x0000000000003430
105 AddressAlign: 0x0000000000000008
106 Content: CC330000EC330000EC3300000C3400000C3400002C340000
112 Value: 0x00000000000012EC
113 Size: 0x000000000000003C
118 Value: 0x00000000000012B0
119 Size: 0x000000000000003C
124 Value: 0x0000000000001328
125 Size: 0x000000000000003C
128 # RUN: yaml2obj %s -o %t.so
129 # RUN: llvm-xray extract %t.so -s | FileCheck %s
132 # CHECK-NEXT: - { id: 1, address: 0x12B0, function: 0x12B0, kind: function-enter, always-instrument: true, function-name: 'foo()' }
133 # CHECK-NEXT: - { id: 1, address: 0x12CC, function: 0x12B0, kind: function-exit, always-instrument: true, function-name: 'foo()' }
134 # CHECK-NEXT: - { id: 2, address: 0x12EC, function: 0x12EC, kind: function-enter, always-instrument: true, function-name: 'bar()' }
135 # CHECK-NEXT: - { id: 2, address: 0x1308, function: 0x12EC, kind: function-exit, always-instrument: true, function-name: 'bar()' }
136 # CHECK-NEXT: - { id: 3, address: 0x1328, function: 0x1328, kind: function-enter, always-instrument: true, function-name: 'jar()' }
137 # CHECK-NEXT: - { id: 3, address: 0x1344, function: 0x1328, kind: function-exit, always-instrument: true, function-name: 'jar()' }
140 # RUN: llvm-xray extract -s --no-demangle %t.so | FileCheck --check-prefix=MANGLED %s
143 # MANGLED-NEXT: - { id: 1, address: 0x12B0, function: 0x12B0, kind: function-enter, always-instrument: true, function-name: _Z3foov }
144 # MANGLED-NEXT: - { id: 1, address: 0x12CC, function: 0x12B0, kind: function-exit, always-instrument: true, function-name: _Z3foov }
145 # MANGLED-NEXT: - { id: 2, address: 0x12EC, function: 0x12EC, kind: function-enter, always-instrument: true, function-name: _Z3barv }
146 # MANGLED-NEXT: - { id: 2, address: 0x1308, function: 0x12EC, kind: function-exit, always-instrument: true, function-name: _Z3barv }
147 # MANGLED-NEXT: - { id: 3, address: 0x1328, function: 0x1328, kind: function-enter, always-instrument: true, function-name: _Z3jarv }
148 # MANGLED-NEXT: - { id: 3, address: 0x1344, function: 0x1328, kind: function-exit, always-instrument: true, function-name: _Z3jarv }