1 # REQUIRES: system-linux
2 # RUN: llvm-bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin --print-pseudo-probes=all -o %t.bolt --lite=0 --enable-bat 2>&1 | FileCheck %s
4 # PREAGG: B X:0 #foo# 1 0
5 # PREAGG: B X:0 #bar# 1 0
6 # PREAGG: B X:0 #main# 1 0
7 ## Check pseudo-probes in regular YAML profile (non-BOLTed binary)
8 # RUN: link_fdata %s %S/../../../llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin %t.preagg PREAGG
9 # RUN: perf2bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin -p %t.preagg --pa -w %t.yaml -o %t.fdata --profile-write-pseudo-probes
10 # RUN: FileCheck --input-file %t.yaml %s --check-prefix CHECK-YAML
11 ## Check pseudo-probes in BAT YAML profile (BOLTed binary)
12 # RUN: link_fdata %s %t.bolt %t.preagg2 PREAGG
13 # RUN: perf2bolt %t.bolt -p %t.preagg2 --pa -w %t.yaml2 -o %t.fdata2 --profile-write-pseudo-probes
14 # RUN: FileCheck --input-file %t.yaml2 %s --check-prefix CHECK-YAML
15 # CHECK-YAML: name: bar
16 # CHECK-YAML: - bid: 0
17 # CHECK-YAML: probes: [ { blx: 9 } ]
18 # CHECK-YAML: inline_tree: [ { } ]
20 # CHECK-YAML: name: foo
21 # CHECK-YAML: - bid: 0
22 # CHECK-YAML: probes: [ { blx: 3 } ]
23 # CHECK-YAML: inline_tree: [ { g: 1 }, { g: 0, cs: 8 } ]
25 # CHECK-YAML: name: main
26 # CHECK-YAML: - bid: 0
27 # CHECK-YAML: probes: [ { blx: 3, id: 1 }, { blx: 1 } ]
28 # CHECK-YAML: inline_tree: [ { g: 2 }, { g: 1, cs: 2 }, { g: 0, p: 1, cs: 8 } ]
30 # CHECK-YAML: pseudo_probe_desc:
31 # CHECK-YAML-NEXT: gs: [ 0xE413754A191DB537, 0x5CF8C24CDB18BDAC, 0xDB956436E78DD5FA ]
32 # CHECK-YAML-NEXT: gh: [ 2, 0, 1 ]
33 # CHECK-YAML-NEXT: hs: [ 0x200205A19C5B4, 0x10000FFFFFFFF, 0x10E852DA94 ]
35 ## Check that without --profile-write-pseudo-probes option, no pseudo probes are
37 # RUN: perf2bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/inline-cs-pseudoprobe.perfbin -p %t.preagg --pa -w %t.yaml3 -o %t.fdata
38 # RUN: FileCheck --input-file %t.yaml3 %s --check-prefix CHECK-NO-OPT
39 # CHECK-NO-OPT-NOT: probes:
40 # CHECK-NO-OPT-NOT: inline_tree:
41 # CHECK-NO-OPT-NOT: pseudo_probe_desc:
43 CHECK: Report of decoding input pseudo probe binaries
45 CHECK-NEXT: Pseudo Probe Desc:
46 CHECK-NEXT: GUID: 6699318081062747564 Name: foo
47 CHECK-NEXT: Hash: 563088904013236
48 CHECK-NEXT: GUID: 15822663052811949562 Name: main
49 CHECK-NEXT: Hash: 281479271677951
50 CHECK-NEXT: GUID: 16434608426314478903 Name: bar
51 CHECK-NEXT: Hash: 72617220756
53 CHECK: [Probe]: FUNC: bar Index: 1 Type: Block
54 CHECK: [Probe]: FUNC: bar Index: 4 Type: Block
55 CHECK: [Probe]: FUNC: foo Index: 1 Type: Block
56 CHECK: [Probe]: FUNC: foo Index: 2 Type: Block
57 CHECK: [Probe]: FUNC: foo Index: 5 Type: Block
58 CHECK: [Probe]: FUNC: foo Index: 6 Type: Block
59 CHECK: [Probe]: FUNC: foo Index: 2 Type: Block
60 CHECK: [Probe]: FUNC: foo Index: 3 Type: Block
61 CHECK: [Probe]: FUNC: foo Index: 4 Type: Block
62 CHECK: [Probe]: FUNC: bar Index: 1 Type: Block Inlined: @ foo:8
63 CHECK: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ foo:8
64 CHECK: [Probe]: FUNC: foo Index: 6 Type: Block
65 CHECK: [Probe]: FUNC: foo Index: 2 Type: Block
66 CHECK: [Probe]: FUNC: foo Index: 7 Type: Block
67 CHECK: [Probe]: FUNC: foo Index: 9 Type: DirectCall
68 CHECK: [Probe]: FUNC: main Index: 1 Type: Block
69 CHECK: [Probe]: FUNC: foo Index: 1 Type: Block Inlined: @ main:2
70 CHECK: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2
71 CHECK: [Probe]: FUNC: foo Index: 5 Type: Block Inlined: @ main:2
72 CHECK: [Probe]: FUNC: foo Index: 6 Type: Block Inlined: @ main:2
73 CHECK: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2
74 CHECK: [Probe]: FUNC: foo Index: 3 Type: Block Inlined: @ main:2
75 CHECK: [Probe]: FUNC: foo Index: 4 Type: Block Inlined: @ main:2
76 CHECK: [Probe]: FUNC: bar Index: 1 Type: Block Inlined: @ main:2 @ foo:8
77 CHECK: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ main:2 @ foo:8
78 CHECK: [Probe]: FUNC: foo Index: 6 Type: Block Inlined: @ main:2
79 CHECK: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2
80 CHECK: [Probe]: FUNC: foo Index: 7 Type: Block Inlined: @ main:2
81 CHECK: [Probe]: FUNC: foo Index: 9 Type: DirectCall Inlined: @ main:2
83 CHECK: Pseudo Probe Address Conversion results:
85 CHECK: Address: 0x201750 FUNC: bar Index: 1 Type: Block
86 CHECK: Address: 0x201750 FUNC: bar Index: 4 Type: Block
87 CHECK: Address: 0x201770 FUNC: foo Index: 1 Type: Block
88 CHECK: Address: 0x201770 FUNC: foo Index: 2 Type: Block
89 CHECK: Address: 0x20177d FUNC: foo Index: 5 Type: Block
90 CHECK: Address: 0x20177d FUNC: foo Index: 6 Type: Block
91 CHECK: Address: 0x20177d FUNC: foo Index: 2 Type: Block
92 CHECK: Address: 0x20178b FUNC: foo Index: 3 Type: Block
93 CHECK: Address: 0x2017aa FUNC: foo Index: 4 Type: Block
94 CHECK: Address: 0x2017aa FUNC: bar Index: 1 Type: Block Inlined: @ foo:8
95 CHECK: Address: 0x2017aa FUNC: bar Index: 4 Type: Block Inlined: @ foo:8
96 CHECK: Address: 0x2017aa FUNC: foo Index: 6 Type: Block
97 CHECK: Address: 0x2017aa FUNC: foo Index: 2 Type: Block
98 CHECK: Address: 0x2017d7 FUNC: foo Index: 7 Type: Block
99 CHECK: Address: 0x2017e2 FUNC: foo Index: 9 Type: DirectCall
100 CHECK: Address: 0x2017f0 FUNC: main Index: 1 Type: Block
101 CHECK: Address: 0x2017f0 FUNC: foo Index: 1 Type: Block Inlined: @ main:2
102 CHECK: Address: 0x2017f0 FUNC: foo Index: 2 Type: Block Inlined: @ main:2
103 CHECK: Address: 0x2017fd FUNC: foo Index: 5 Type: Block Inlined: @ main:2
104 CHECK: Address: 0x2017fd FUNC: foo Index: 6 Type: Block Inlined: @ main:2
105 CHECK: Address: 0x2017fd FUNC: foo Index: 2 Type: Block Inlined: @ main:2
106 CHECK: Address: 0x20180b FUNC: foo Index: 3 Type: Block Inlined: @ main:2
107 CHECK: Address: 0x20182a FUNC: foo Index: 4 Type: Block Inlined: @ main:2
108 CHECK: Address: 0x20182a FUNC: bar Index: 1 Type: Block Inlined: @ main:2 @ foo:8
109 CHECK: Address: 0x20182a FUNC: bar Index: 4 Type: Block Inlined: @ main:2 @ foo:8
110 CHECK: Address: 0x20182a FUNC: foo Index: 6 Type: Block Inlined: @ main:2
111 CHECK: Address: 0x20182a FUNC: foo Index: 2 Type: Block Inlined: @ main:2
112 CHECK: Address: 0x201857 FUNC: foo Index: 7 Type: Block Inlined: @ main:2
113 CHECK: Address: 0x201862 FUNC: foo Index: 9 Type: DirectCall Inlined: @ main:2
115 CHECK: Address: 2103120
116 CHECK-NEXT: [Probe]: FUNC: bar Index: 1 Type: Block
117 CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block
118 CHECK-NEXT: Address: 2103152
119 CHECK-NEXT: [Probe]: FUNC: foo Index: 1 Type: Block
120 CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block
121 CHECK-NEXT: Address: 2103165
122 CHECK-NEXT: [Probe]: FUNC: foo Index: 5 Type: Block
123 CHECK-NEXT: [Probe]: FUNC: foo Index: 6 Type: Block
124 CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block
125 CHECK-NEXT: Address: 2103179
126 CHECK-NEXT: [Probe]: FUNC: foo Index: 3 Type: Block
127 CHECK-NEXT: Address: 2103210
128 CHECK-NEXT: [Probe]: FUNC: foo Index: 4 Type: Block
129 CHECK-NEXT: [Probe]: FUNC: foo Index: 6 Type: Block
130 CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block
131 CHECK-NEXT: [Probe]: FUNC: bar Index: 1 Type: Block Inlined: @ foo:8
132 CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ foo:8
133 CHECK-NEXT: Address: 2103255
134 CHECK-NEXT: [Probe]: FUNC: foo Index: 7 Type: Block
135 CHECK-NEXT: Address: 2103266
136 CHECK-NEXT: [Probe]: FUNC: foo Index: 9 Type: DirectCall
137 CHECK-NEXT: Address: 2103280
138 CHECK-NEXT: [Probe]: FUNC: main Index: 1 Type: Block
139 CHECK-NEXT: [Probe]: FUNC: foo Index: 1 Type: Block Inlined: @ main:2
140 CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2
141 CHECK-NEXT: Address: 2103293
142 CHECK-NEXT: [Probe]: FUNC: foo Index: 5 Type: Block Inlined: @ main:2
143 CHECK-NEXT: [Probe]: FUNC: foo Index: 6 Type: Block Inlined: @ main:2
144 CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2
145 CHECK-NEXT: Address: 2103307
146 CHECK-NEXT: [Probe]: FUNC: foo Index: 3 Type: Block Inlined: @ main:2
147 CHECK-NEXT: Address: 2103338
148 CHECK-NEXT: [Probe]: FUNC: foo Index: 4 Type: Block Inlined: @ main:2
149 CHECK-NEXT: [Probe]: FUNC: foo Index: 6 Type: Block Inlined: @ main:2
150 CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2
151 CHECK-NEXT: [Probe]: FUNC: bar Index: 1 Type: Block Inlined: @ main:2 @ foo:8
152 CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ main:2 @ foo:8
153 CHECK-NEXT: Address: 2103383
154 CHECK-NEXT: [Probe]: FUNC: foo Index: 7 Type: Block Inlined: @ main:2
155 CHECK-NEXT: Address: 2103394
156 CHECK-NEXT: [Probe]: FUNC: foo Index: 9 Type: DirectCall Inlined: @ main:2