llvm.org GIT mirror llvm / 193dc0b
Disable wrapping llvm-xray YAML output Summary: The YAML output produced by llvm-xray is supposed to be wrapped at the arbitrary default of 70 columns set by `yaml:Output`. Unfortunately, the wrapping is rather unpredictable, and can easily go past the set number of columns, depending on the execution environment. To make the YAML output environment-independent, disable wrapping instead. Reviewers: dberris Reviewed By: dberris Subscribers: fhahn, llvm-commits Differential Revision: https://reviews.llvm.org/D29962 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295116 91177308-0d34-0410-b5e6-96231b3b80d8 Dimitry Andric 3 years ago
12 changed file(s) with 54 addition(s) and 106 deletion(s). Raw diff Collapse all Expand all
0 ---
1 - { id: 1, address: 0x000000000041CA40, function: 0x000000000041CA40, kind: function-enter,
2 always-instrument: true }
3 - { id: 1, address: 0x000000000041CA50, function: 0x000000000041CA40, kind: tail-exit,
4 always-instrument: true }
5 - { id: 2, address: 0x000000000041CA70, function: 0x000000000041CA70, kind: function-enter,
6 always-instrument: true }
7 - { id: 2, address: 0x000000000041CA7C, function: 0x000000000041CA70, kind: tail-exit,
8 always-instrument: true }
9 - { id: 3, address: 0x000000000041CAA0, function: 0x000000000041CAA0, kind: function-enter,
10 always-instrument: true }
11 - { id: 3, address: 0x000000000041CAB4, function: 0x000000000041CAA0, kind: function-exit,
12 always-instrument: true }
1 - { id: 1, address: 0x000000000041CA40, function: 0x000000000041CA40, kind: function-enter, always-instrument: true }
2 - { id: 1, address: 0x000000000041CA50, function: 0x000000000041CA40, kind: tail-exit, always-instrument: true }
3 - { id: 2, address: 0x000000000041CA70, function: 0x000000000041CA70, kind: function-enter, always-instrument: true }
4 - { id: 2, address: 0x000000000041CA7C, function: 0x000000000041CA70, kind: tail-exit, always-instrument: true }
5 - { id: 3, address: 0x000000000041CAA0, function: 0x000000000041CAA0, kind: function-enter, always-instrument: true }
6 - { id: 3, address: 0x000000000041CAB4, function: 0x000000000041CAA0, kind: function-exit, always-instrument: true }
137 ...
66 nonstop-tsc: true
77 cycle-frequency: 2601000000
88 records:
9 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter,
10 tsc: 10001 }
11 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit,
12 tsc: 10100 }
9 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10001 }
10 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10100 }
1311 ...
1412
1513 #CHECK: Functions with latencies: 1
1616 cycle-frequency: 1
1717 records:
1818 # Function id: 1
19 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter,
20 tsc: 10001 }
21 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit,
22 tsc: 10100 }
23 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter,
24 tsc: 10101 }
25 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit,
26 tsc: 10200 }
27 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter,
28 tsc: 10201 }
29 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit,
30 tsc: 10300 }
19 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10001 }
20 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10100 }
21 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10101 }
22 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10200 }
23 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10201 }
24 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10300 }
3125 # Function id: 2
32 - { type: 0, func-id: 2, cpu: 1, thread: 222, kind: function-enter,
33 tsc: 10001 }
34 - { type: 0, func-id: 2, cpu: 1, thread: 222, kind: function-exit,
35 tsc: 10002 }
36 - { type: 0, func-id: 2, cpu: 1, thread: 222, kind: function-enter,
37 tsc: 10101 }
38 - { type: 0, func-id: 2, cpu: 1, thread: 222, kind: function-exit,
39 tsc: 10102 }
26 - { type: 0, func-id: 2, cpu: 1, thread: 222, kind: function-enter, tsc: 10001 }
27 - { type: 0, func-id: 2, cpu: 1, thread: 222, kind: function-exit, tsc: 10002 }
28 - { type: 0, func-id: 2, cpu: 1, thread: 222, kind: function-enter, tsc: 10101 }
29 - { type: 0, func-id: 2, cpu: 1, thread: 222, kind: function-exit, tsc: 10102 }
4030
4131 #DEFAULT: Functions with latencies: 2
4232 #DEFAULT-NEXT: funcid count [ min, med, 90p, 99p, max] sum function
66 nonstop-tsc: true
77 cycle-frequency: 2601000000
88 records:
9 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter,
10 tsc: 10001 }
11 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit,
12 tsc: 10100 }
9 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10001 }
10 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10100 }
1311 ...
1412
1513 #CHECK: ---
2018 #CHECK-NEXT: nonstop-tsc: true
2119 #CHECK-NEXT: cycle-frequency: 2601000000
2220 #CHECK-NEXT: records:
23 #CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 1, thread: 111, kind: function-enter,
24 #CHECK-NEXT: tsc: 10001 }
25 #CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 1, thread: 111, kind: function-exit,
26 #CHECK-NEXT: tsc: 10100 }
21 #CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 1, thread: 111, kind: function-enter, tsc: 10001 }
22 #CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 1, thread: 111, kind: function-exit, tsc: 10100 }
2723 #CHECK-NEXT: ...
77 ; CHECK-NEXT: nonstop-tsc: true
88 ; CHECK-NEXT: cycle-frequency: 2601000000
99 ; CHECK-NEXT: records:
10 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '3', cpu: 37, thread: 84697, kind: function-enter,
11 ; CHECK-NEXT: tsc: 3315356841453914 }
12 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '2', cpu: 37, thread: 84697, kind: function-enter,
13 ; CHECK-NEXT: tsc: 3315356841454542 }
14 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '2', cpu: 37, thread: 84697, kind: function-exit,
15 ; CHECK-NEXT: tsc: 3315356841454670 }
16 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 37, thread: 84697, kind: function-enter,
17 ; CHECK-NEXT: tsc: 3315356841454762 }
18 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 37, thread: 84697, kind: function-exit,
19 ; CHECK-NEXT: tsc: 3315356841454802 }
20 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '3', cpu: 37, thread: 84697, kind: function-exit,
21 ; CHECK-NEXT: tsc: 3315356841494828 }
10 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '3', cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841453914 }
11 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '2', cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841454542 }
12 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '2', cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841454670 }
13 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841454762 }
14 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841454802 }
15 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '3', cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841494828 }
2216 ; CHECK-NEXT: ...
77 ; CHECK-NEXT: nonstop-tsc: true
88 ; CHECK-NEXT: cycle-frequency: 2601000000
99 ; CHECK-NEXT: records:
10 ; CHECK-NEXT: - { type: 0, func-id: 3, function: main, cpu: 37, thread: 84697, kind: function-enter,
11 ; CHECK-NEXT: tsc: 3315356841453914 }
12 ; CHECK-NEXT: - { type: 0, func-id: 2, function: {{.*foo.*}}, cpu: 37, thread: 84697, kind: function-enter,
13 ; CHECK-NEXT: tsc: 3315356841454542 }
14 ; CHECK-NEXT: - { type: 0, func-id: 2, function: {{.*foo.*}}, cpu: 37, thread: 84697, kind: function-exit,
15 ; CHECK-NEXT: tsc: 3315356841454670 }
16 ; CHECK-NEXT: - { type: 0, func-id: 1, function: {{.*bar.*}}, cpu: 37, thread: 84697, kind: function-enter,
17 ; CHECK-NEXT: tsc: 3315356841454762 }
18 ; CHECK-NEXT: - { type: 0, func-id: 1, function: {{.*bar.*}}, cpu: 37, thread: 84697, kind: function-exit,
19 ; CHECK-NEXT: tsc: 3315356841454802 }
20 ; CHECK-NEXT: - { type: 0, func-id: 3, function: main, cpu: 37, thread: 84697, kind: function-exit,
21 ; CHECK-NEXT: tsc: 3315356841494828 }
10 ; CHECK-NEXT: - { type: 0, func-id: 3, function: main, cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841453914 }
11 ; CHECK-NEXT: - { type: 0, func-id: 2, function: {{.*foo.*}}, cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841454542 }
12 ; CHECK-NEXT: - { type: 0, func-id: 2, function: {{.*foo.*}}, cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841454670 }
13 ; CHECK-NEXT: - { type: 0, func-id: 1, function: {{.*bar.*}}, cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841454762 }
14 ; CHECK-NEXT: - { type: 0, func-id: 1, function: {{.*bar.*}}, cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841454802 }
15 ; CHECK-NEXT: - { type: 0, func-id: 3, function: main, cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841494828 }
2216 ; CHECK-NEXT: ...
77 ; CHECK-NEXT: nonstop-tsc: true
88 ; CHECK-NEXT: cycle-frequency: 2601000000
99 ; CHECK-NEXT: records:
10 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '@(41caa0)', cpu: 37, thread: 84697,
11 ; CHECK-NEXT: kind: function-enter, tsc: 3315356841453914 }
12 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '@(41ca70)', cpu: 37, thread: 84697,
13 ; CHECK-NEXT: kind: function-enter, tsc: 3315356841454542 }
14 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '@(41ca70)', cpu: 37, thread: 84697,
15 ; CHECK-NEXT: kind: function-exit, tsc: 3315356841454670 }
16 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '@(41ca40)', cpu: 37, thread: 84697,
17 ; CHECK-NEXT: kind: function-enter, tsc: 3315356841454762 }
18 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '@(41ca40)', cpu: 37, thread: 84697,
19 ; CHECK-NEXT: kind: function-exit, tsc: 3315356841454802 }
20 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '@(41caa0)', cpu: 37, thread: 84697,
21 ; CHECK-NEXT: kind: function-exit, tsc: 3315356841494828 }
10 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '@(41caa0)', cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841453914 }
11 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '@(41ca70)', cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841454542 }
12 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '@(41ca70)', cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841454670 }
13 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '@(41ca40)', cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841454762 }
14 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '@(41ca40)', cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841454802 }
15 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '@(41caa0)', cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841494828 }
2216 ; CHECK-NEXT: ...
77 ; CHECK-NEXT: nonstop-tsc: true
88 ; CHECK-NEXT: cycle-frequency: 2601000000
99 ; CHECK-NEXT: records:
10 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '3', cpu: 37, thread: 84697, kind: function-enter,
11 ; CHECK-NEXT: tsc: 3315356841453914 }
12 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '2', cpu: 37, thread: 84697, kind: function-enter,
13 ; CHECK-NEXT: tsc: 3315356841454542 }
14 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '2', cpu: 37, thread: 84697, kind: function-exit,
15 ; CHECK-NEXT: tsc: 3315356841454670 }
16 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 37, thread: 84697, kind: function-enter,
17 ; CHECK-NEXT: tsc: 3315356841454762 }
18 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 37, thread: 84697, kind: function-exit,
19 ; CHECK-NEXT: tsc: 3315356841454802 }
20 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '3', cpu: 37, thread: 84697, kind: function-exit,
21 ; CHECK-NEXT: tsc: 3315356841494828 }
10 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '3', cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841453914 }
11 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '2', cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841454542 }
12 ; CHECK-NEXT: - { type: 0, func-id: 2, function: '2', cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841454670 }
13 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 37, thread: 84697, kind: function-enter, tsc: 3315356841454762 }
14 ; CHECK-NEXT: - { type: 0, func-id: 1, function: '1', cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841454802 }
15 ; CHECK-NEXT: - { type: 0, func-id: 3, function: '3', cpu: 37, thread: 84697, kind: function-exit, tsc: 3315356841494828 }
2216 ; CHECK-NEXT: ...
33 ; RUN: llvm-xray extract %S/Inputs/elf64-example.bin | FileCheck %s
44
55 ; CHECK: ---
6 ; CHECK-NEXT: - { id: 1, address: 0x000000000041C900, function: 0x000000000041C900, kind: function-enter,
7 ; CHECK-NEXT: always-instrument: true }
8 ; CHECK-NEXT: - { id: 1, address: 0x000000000041C912, function: 0x000000000041C900, kind: function-exit,
9 ; CHECK-NEXT: always-instrument: true }
10 ; CHECK-NEXT: - { id: 2, address: 0x000000000041C930, function: 0x000000000041C930, kind: function-enter,
11 ; CHECK-NEXT: always-instrument: true }
12 ; CHECK-NEXT: - { id: 2, address: 0x000000000041C946, function: 0x000000000041C930, kind: function-exit,
13 ; CHECK-NEXT: always-instrument: true }
6 ; CHECK-NEXT: - { id: 1, address: 0x000000000041C900, function: 0x000000000041C900, kind: function-enter, always-instrument: true }
7 ; CHECK-NEXT: - { id: 1, address: 0x000000000041C912, function: 0x000000000041C900, kind: function-exit, always-instrument: true }
8 ; CHECK-NEXT: - { id: 2, address: 0x000000000041C930, function: 0x000000000041C930, kind: function-enter, always-instrument: true }
9 ; CHECK-NEXT: - { id: 2, address: 0x000000000041C946, function: 0x000000000041C930, kind: function-exit, always-instrument: true }
1410 ; CHECK-NEXT: ...
2222 nonstop-tsc: true
2323 cycle-frequency: 2601000000
2424 records:
25 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter,
26 tsc: 10001 }
27 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit,
28 tsc: 10100 }
25 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10001 }
26 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10100 }
2927 ...
3028
3129
8787 : llvm::to_string(R.FuncId),
8888 R.TSC, R.TId});
8989 }
90 Output Out(OS);
90 Output Out(OS, nullptr, 0);
9191 Out << Trace;
9292 }
9393
5959 YAMLSleds.push_back({*FuncId, Sled.Address, Sled.Function, Sled.Kind,
6060 Sled.AlwaysInstrument});
6161 }
62 Output Out(OS);
62 Output Out(OS, nullptr, 0);
6363 Out << YAMLSleds;
6464 }
6565