1 #RUN: llvm-xray stack -per-thread-stacks %s | FileCheck %s --check-prefix PER-THREAD
2 #RUN: llvm-xray stack -aggregate-threads %s | FileCheck %s --check-prefix AGGREGATE
10 cycle-frequency: 2601000000
12 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10001 }
13 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10100 }
14 - { type: 1, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10101 }
15 - { type: 1, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10301 }
16 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10401 }
17 - { type: 0, func-id: 2, cpu: 1, thread: 111, kind: function-enter, tsc: 10501 }
18 - { type: 0, func-id: 3, cpu: 1, thread: 111, kind: function-enter, tsc: 10601 }
19 - { type: 1, func-id: 3, cpu: 1, thread: 111, kind: function-exit, tsc: 10701 }
20 - { type: 1, func-id: 2, cpu: 1, thread: 111, kind: function-exit, tsc: 10751 }
21 - { type: 1, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10775 }
22 - { type: 0, func-id: 1, cpu: 1, thread: 123, kind: function-enter, tsc: 10401 }
23 - { type: 0, func-id: 2, cpu: 1, thread: 123, kind: function-enter, tsc: 10501 }
24 - { type: 0, func-id: 3, cpu: 1, thread: 123, kind: function-enter, tsc: 10701 }
25 - { type: 1, func-id: 3, cpu: 1, thread: 123, kind: function-exit, tsc: 10801 }
26 - { type: 1, func-id: 2, cpu: 1, thread: 123, kind: function-exit, tsc: 10951 }
27 - { type: 1, func-id: 1, cpu: 1, thread: 123, kind: function-exit, tsc: 11075 }
28 - { type: 0, func-id: 2, cpu: 1, thread: 200, kind: function-enter, tsc: 0 }
29 - { type: 0, func-id: 3, cpu: 1, thread: 200, kind: function-enter, tsc: 10 }
30 - { type: 1, func-id: 3, cpu: 1, thread: 200, kind: function-exit, tsc: 20 }
31 - { type: 1, func-id: 2, cpu: 1, thread: 200, kind: function-exit, tsc: 30 }
33 # PER-THREAD: Thread 123
34 # PER-THREAD: Unique Stacks: 1
35 # PER-THREAD: Top 10 Stacks by leaf sum:
36 # PER-THREAD: Sum: 100
37 # PER-THREAD: lvl function{{[[:space:]]+}}count{{[[:space:]]+}}sum
38 # PER-THREAD: #0 #1{{[[:space:]]+}}1{{[[:space:]]+}}674
39 # PER-THREAD: #1 #2{{[[:space:]]+}}1{{[[:space:]]+}}450
40 # PER-THREAD: #2 #3{{[[:space:]]+}}1{{[[:space:]]+}}100
41 # PER-THREAD: Top 10 Stacks by leaf count:
42 # PER-THREAD: #0 #1{{[[:space:]]+}}1{{[[:space:]]+}}674
43 # PER-THREAD: #1 #2{{[[:space:]]+}}1{{[[:space:]]+}}450
44 # PER-THREAD: #2 #3{{[[:space:]]+}}1{{[[:space:]]+}}100
45 # PER-THREAD: lvl function{{[[:space:]]+}}count{{[[:space:]]+}}sum
47 # AGGREGATE: Unique Stacks: 3
48 # AGGREGATE: Top 10 Stacks by leaf sum:
51 # AGGREGATE: lvl function{{[[:space:]]+}}count{{[[:space:]]+}}sum
52 # AGGREGATE: #0 #1{{[[:space:]]+}}3{{[[:space:]]+}}1348
53 # AGGREGATE: #1 #2{{[[:space:]]+}}2{{[[:space:]]+}}700
54 # AGGREGATE: #2 #3{{[[:space:]]+}}2{{[[:space:]]+}}200
57 # AGGREGATE: lvl function{{[[:space:]]+}}count{{[[:space:]]+}}sum
58 # AGGREGATE: #0 #2{{[[:space:]]+}}1{{[[:space:]]+}}30
59 # AGGREGATE: #1 #3{{[[:space:]]+}}1{{[[:space:]]+}}10
62 # AGGREGATE: lvl function{{[[:space:]]+}}count{{[[:space:]]+}}sum
63 # AGGREGATE: #0 #1{{[[:space:]]+}}2{{[[:space:]]+}}674
64 # AGGREGATE: #1 #1{{[[:space:]]+}}1{{[[:space:]]+}}1
67 # AGGREGATE: Top 10 Stacks by leaf count:
70 # AGGREGATE: lvl function{{[[:space:]]+}}count{{[[:space:]]+}}sum
71 # AGGREGATE: #0 #1{{[[:space:]]+}}3{{[[:space:]]+}}1348
72 # AGGREGATE: #1 #2{{[[:space:]]+}}2{{[[:space:]]+}}700
73 # AGGREGATE: #2 #3{{[[:space:]]+}}2{{[[:space:]]+}}200
76 # AGGREGATE: lvl function{{[[:space:]]+}}count{{[[:space:]]+}}sum
77 # AGGREGATE: #0 #2{{[[:space:]]+}}1{{[[:space:]]+}}30
78 # AGGREGATE: #1 #3{{[[:space:]]+}}1{{[[:space:]]+}}10
81 # AGGREGATE: lvl function{{[[:space:]]+}}count{{[[:space:]]+}}sum
82 # AGGREGATE: #0 #1{{[[:space:]]+}}2{{[[:space:]]+}}674
83 # AGGREGATE: #1 #1{{[[:space:]]+}}1{{[[:space:]]+}}1