1 ; RUN: llvm-profgen --format=text --perfscript=%s --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --output=%t --show-pseudo-probe --show-disassembly-only | FileCheck %s
3 PERF_RECORD_MMAP2 2854748/2854748: [0x400000(0x1000) @ 0 00:1d 123291722 526021]: r-xp /home/inline-cs-pseudoprobe.perfbin
5 ; CHECK: Pseudo Probe Desc:
6 ; CHECK: GUID: 6699318081062747564 Name: foo
7 ; CHECK: Hash: 563088904013236
8 ; CHECK: GUID: 15822663052811949562 Name: main
9 ; CHECK: Hash: 281479271677951
10 ; CHECK: GUID: 16434608426314478903 Name: bar
11 ; CHECK: Hash: 72617220756
17 ; CHECK: [Probe]: FUNC: bar Index: 1 Type: Block
18 ; CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block
19 ; CHECK-NEXT: 754: imull $2863311531, %edi, %eax
22 ; CHECK: [Probe]: FUNC: foo Index: 1 Type: Block
23 ; CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block
24 ; CHECK-NEXT: 770: movl $1, %ecx
26 ; CHECK: [Probe]: FUNC: foo Index: 5 Type: Block
27 ; CHECK-NEXT: 780: addl $30, %esi
28 ; CHECK: [Probe]: FUNC: foo Index: 6 Type: Block
29 ; CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block
30 ; CHECK-NEXT: 783: addl $1, %ecx
32 ; CHECK: [Probe]: FUNC: foo Index: 3 Type: Block
33 ; CHECK-NEXT: 78e: movl %ecx, %edx
35 ; CHECK: [Probe]: FUNC: foo Index: 4 Type: Block
36 ; CHECK-NEXT: [Probe]: FUNC: bar Index: 1 Type: Block Inlined: @ foo:8
37 ; CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ foo:8
38 ; CHECK-NEXT: 7bf: addl %ecx, %edx
41 ; CHECK: [Probe]: FUNC: foo Index: 6 Type: Block
42 ; CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block
43 ; CHECK-NEXT: 7cf: addl $1, %ecx
45 ; CHECK: [Probe]: FUNC: foo Index: 7 Type: Block
46 ; CHECK-NEXT: 7de: movl $2098432, %edi
48 ; CHECK: [Probe]: FUNC: foo Index: 9 Type: DirectCall
49 ; CHECK-NEXT: 7e5: callq 0x930
53 ; CHECK: [Probe]: FUNC: main Index: 1 Type: Block
54 ; CHECK-NEXT: [Probe]: FUNC: foo Index: 1 Type: Block Inlined: @ main:2
55 ; CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2
56 ; CHECK-NEXT: 7f0: movl $1, %ecx
58 ; CHECK: [Probe]: FUNC: foo Index: 5 Type: Block Inlined: @ main:2
59 ; CHECK-NEXT: 800: addl $30, %esi
60 ; CHECK: [Probe]: FUNC: foo Index: 6 Type: Block Inlined: @ main:2
61 ; CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2
62 ; CHECK-NEXT: 803: addl $1, %ecx
64 ; CHECK: [Probe]: FUNC: foo Index: 3 Type: Block Inlined: @ main:2
65 ; CHECK-NEXT: 80e: movl %ecx, %edx
67 ; CHECK: [Probe]: FUNC: foo Index: 4 Type: Block Inlined: @ main:2
68 ; CHECK-NEXT: [Probe]: FUNC: bar Index: 1 Type: Block Inlined: @ main:2 @ foo:8
69 ; CHECK-NEXT: [Probe]: FUNC: bar Index: 4 Type: Block Inlined: @ main:2 @ foo:8
70 ; CHECK-NEXT: 83f: addl %ecx, %edx
72 ; CHECK: [Probe]: FUNC: foo Index: 6 Type: Block Inlined: @ main:2
73 ; CHECK-NEXT: [Probe]: FUNC: foo Index: 2 Type: Block Inlined: @ main:2
74 ; CHECK-NEXT: 84f: addl $1, %ecx
76 ; CHECK: [Probe]: FUNC: foo Index: 7 Type: Block Inlined: @ main:2
77 ; CHECK-NEXT: 85e: movl $2098432, %edi
79 ; CHECK: [Probe]: FUNC: foo Index: 9 Type: DirectCall Inlined: @ main:2
80 ; CHECK-NEXT: 865: callq 0x930
83 ; clang -O3 -fexperimental-new-pass-manager -fuse-ld=lld -fpseudo-probe-for-profiling
84 ; -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Xclang -mdisable-tail-calls
89 int bar(int x, int y) {
98 while (i++ < 4000 * 4000)
99 if (i % 91) s = bar(i, s); else s += 30;
100 printf("sum is %d\n", s);