1 # REQUIRES: system-linux
2 # RUN: llvm-bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/noinline-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
8 ## Check pseudo-probes in regular YAML profile (non-BOLTed binary)
9 # RUN: link_fdata %s %S/../../../llvm/test/tools/llvm-profgen/Inputs/noinline-cs-pseudoprobe.perfbin %t.preagg PREAGG
10 # RUN: perf2bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/noinline-cs-pseudoprobe.perfbin -p %t.preagg --pa -w %t.yaml -o %t.fdata --profile-write-pseudo-probes
11 # RUN: FileCheck --input-file %t.yaml %s --check-prefix CHECK-YAML
12 ## Check pseudo-probes in BAT YAML profile (BOLTed binary)
13 # RUN: link_fdata %s %t.bolt %t.preagg2 PREAGG
14 # RUN: perf2bolt %t.bolt -p %t.preagg2 --pa -w %t.yaml2 -o %t.fdata2 --profile-write-pseudo-probes
15 # RUN: FileCheck --input-file %t.yaml2 %s --check-prefix CHECK-YAML
16 # CHECK-YAML: name: bar
17 # CHECK-YAML: - bid: 0
18 # CHECK-YAML: probes: [ { blx: 9 } ]
19 # CHECK-YAML: inline_tree: [ { } ]
21 # CHECK-YAML: name: foo
22 # CHECK-YAML: - bid: 0
23 # CHECK-YAML: probes: [ { blx: 3 } ]
24 # CHECK-YAML: inline_tree: [ { g: 2 } ]
26 # CHECK-YAML: name: main
27 # CHECK-YAML: - bid: 0
28 # CHECK-YAML: probes: [ { blx: 1, call: [ 2 ] } ]
29 # CHECK-YAML: inline_tree: [ { g: 1 } ]
31 # CHECK-YAML: pseudo_probe_desc:
32 # CHECK-YAML-NEXT: gs: [ 0xE413754A191DB537, 0xDB956436E78DD5FA, 0x5CF8C24CDB18BDAC ]
33 # CHECK-YAML-NEXT: gh: [ 2, 1, 0 ]
34 # CHECK-YAML-NEXT: hs: [ 0x200205A19C5B4, 0x10000FFFFFFFF, 0x10E852DA94 ]
36 ## Check that without --profile-write-pseudo-probes option, no pseudo probes are
38 # RUN: perf2bolt %S/../../../llvm/test/tools/llvm-profgen/Inputs/noinline-cs-pseudoprobe.perfbin -p %t.preagg --pa -w %t.yaml3 -o %t.fdata
39 # RUN: FileCheck --input-file %t.yaml3 %s --check-prefix CHECK-NO-OPT
40 # CHECK-NO-OPT-NOT: probes:
41 # CHECK-NO-OPT-NOT: inline_tree:
42 # CHECK-NO-OPT-NOT: pseudo_probe_desc:
43 ;; Report of decoding input pseudo probe binaries
45 ; CHECK: GUID: 6699318081062747564 Name: foo
46 ; CHECK: Hash: 563088904013236
47 ; CHECK: GUID: 15822663052811949562 Name: main
48 ; CHECK: Hash: 281479271677951
49 ; CHECK: GUID: 16434608426314478903 Name: bar
50 ; CHECK: Hash: 72617220756
52 CHECK: [Probe]: FUNC: bar Index: 1 Type: Block
53 CHECK: [Probe]: FUNC: bar Index: 4 Type: Block
54 CHECK: [Probe]: FUNC: foo Index: 1 Type: Block
55 CHECK: [Probe]: FUNC: foo Index: 2 Type: Block
56 CHECK: [Probe]: FUNC: foo Index: 5 Type: Block
57 CHECK: [Probe]: FUNC: foo Index: 6 Type: Block
58 CHECK: [Probe]: FUNC: foo Index: 2 Type: Block
59 CHECK: [Probe]: FUNC: foo Index: 3 Type: Block
60 CHECK: [Probe]: FUNC: foo Index: 4 Type: Block
61 CHECK: [Probe]: FUNC: foo Index: 8 Type: DirectCall
62 CHECK: [Probe]: FUNC: foo Index: 6 Type: Block
63 CHECK: [Probe]: FUNC: foo Index: 2 Type: Block
64 CHECK: [Probe]: FUNC: foo Index: 7 Type: Block
65 CHECK: [Probe]: FUNC: foo Index: 9 Type: DirectCall
66 CHECK: [Probe]: FUNC: main Index: 1 Type: Block
67 CHECK: [Probe]: FUNC: main Index: 2 Type: DirectCall
69 CHECK: Pseudo Probe Address Conversion results:
71 CHECK: Address: 0x201760 FUNC: bar Index: 1 Type: Block
72 CHECK: Address: 0x201760 FUNC: bar Index: 4 Type: Block
73 CHECK: Address: 0x201780 FUNC: foo Index: 1 Type: Block
74 CHECK: Address: 0x201780 FUNC: foo Index: 2 Type: Block
75 CHECK: Address: 0x20178d FUNC: foo Index: 5 Type: Block
76 CHECK: Address: 0x20178d FUNC: foo Index: 6 Type: Block
77 CHECK: Address: 0x20178d FUNC: foo Index: 2 Type: Block
78 CHECK: Address: 0x20179b FUNC: foo Index: 3 Type: Block
79 CHECK: Address: 0x2017ba FUNC: foo Index: 4 Type: Block
80 CHECK: Address: 0x2017bc FUNC: foo Index: 8 Type: DirectCall
81 CHECK: Address: 0x2017ba FUNC: foo Index: 6 Type: Block
82 CHECK: Address: 0x2017ba FUNC: foo Index: 2 Type: Block
83 CHECK: Address: 0x2017ce FUNC: foo Index: 7 Type: Block
84 CHECK: Address: 0x2017d5 FUNC: foo Index: 9 Type: DirectCall
85 CHECK: Address: 0x2017f0 FUNC: main Index: 1 Type: Block
86 CHECK: Address: 0x2017f4 FUNC: main Index: 2 Type: DirectCall
88 CHECK: Address: 2103136
89 CHECK-NEXT: [Probe]: FUNC: bar Index: 1 Type: Block
90 CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block
91 CHECK-NEXT: Address: 2103168
92 CHECK-NEXT: [Probe]: FUNC: foo Index: 1 Type: Block
93 CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block
94 CHECK-NEXT: Address: 2103181
95 CHECK-NEXT: [Probe]: FUNC: foo Index: 5 Type: Block
96 CHECK-NEXT: [Probe]: FUNC: foo Index: 6 Type: Block
97 CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block
98 CHECK-NEXT: Address: 2103195
99 CHECK-NEXT: [Probe]: FUNC: foo Index: 3 Type: Block
100 CHECK-NEXT: Address: 2103226
101 CHECK-NEXT: [Probe]: FUNC: foo Index: 4 Type: Block
102 CHECK-NEXT: [Probe]: FUNC: foo Index: 6 Type: Block
103 CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block
104 CHECK-NEXT: Address: 2103228
105 CHECK-NEXT: [Probe]: FUNC: foo Index: 8 Type: DirectCall
106 CHECK-NEXT: Address: 2103246
107 CHECK-NEXT: [Probe]: FUNC: foo Index: 7 Type: Block
108 CHECK-NEXT: Address: 2103253
109 CHECK-NEXT: [Probe]: FUNC: foo Index: 9 Type: DirectCall
110 CHECK-NEXT: Address: 2103280
111 CHECK-NEXT: [Probe]: FUNC: main Index: 1 Type: Block
112 CHECK-NEXT: Address: 2103284
113 CHECK-NEXT: [Probe]: FUNC: main Index: 2 Type: DirectCall