aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/tools/llvm-xray/AArch64/extract-instrmap.test
blob: 947624cb4063dae1b8b1de92f2b7b2b7d254fd04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## This test makes sure we can extract the instrumentation map from an
## XRay-instrumented PIE file.

# RUN: yaml2obj %S/Inputs/elf64-pic.yaml -o %t.so
# RUN: llvm-xray extract %t.so -s | FileCheck %s
# RUN: llvm-xray extract %t.so --no-demangle --demangle -s | FileCheck %s

# CHECK:      ---
# CHECK-NEXT: - { id: 1, address: 0x420, function: 0x420, kind: function-enter, always-instrument: true, function-name: 'foo()' }
# CHECK-NEXT: - { id: 1, address: 0x440, function: 0x420, kind: function-exit, always-instrument: true, function-name: 'foo()' }
# CHECK-NEXT: - { id: 2, address: 0x464, function: 0x464, kind: function-enter, always-instrument: true, function-name: 'bar()' }
# CHECK-NEXT: - { id: 2, address: 0x484, function: 0x464, kind: function-exit, always-instrument: true, function-name: 'bar()' }
# CHECK-NEXT: - { id: 3, address: 0x4A8, function: 0x4A8, kind: function-enter, always-instrument: true, function-name: 'jar()' }
# CHECK-NEXT: - { id: 3, address: 0x4C8, function: 0x4A8, kind: function-exit, always-instrument: true, function-name: 'jar()' }
# CHECK-NEXT: ...

# RUN: llvm-xray extract -s --no-demangle %t.so | FileCheck --check-prefix=MANGLED %s
# RUN: llvm-xray extract -s --demangle --no-demangle %t.so | FileCheck --check-prefix=MANGLED %s

# MANGLED:      ---
# MANGLED-NEXT: - { id: 1, address: 0x420, function: 0x420, kind: function-enter, always-instrument: true, function-name: _Z3foov }
# MANGLED-NEXT: - { id: 1, address: 0x440, function: 0x420, kind: function-exit, always-instrument: true, function-name: _Z3foov }
# MANGLED-NEXT: - { id: 2, address: 0x464, function: 0x464, kind: function-enter, always-instrument: true, function-name: _Z3barv }
# MANGLED-NEXT: - { id: 2, address: 0x484, function: 0x464, kind: function-exit, always-instrument: true, function-name: _Z3barv }
# MANGLED-NEXT: - { id: 3, address: 0x4A8, function: 0x4A8, kind: function-enter, always-instrument: true, function-name: _Z3jarv }
# MANGLED-NEXT: - { id: 3, address: 0x4C8, function: 0x4A8, kind: function-exit, always-instrument: true, function-name: _Z3jarv }
# MANGLED-NEXT: ...