47 lines · yaml
1# RUN: llvm-xray account -d %s -m %S/Inputs/simple-instrmap.yaml | FileCheck --check-prefixes=ALL %s2# RUN: llvm-xray account -d --recursive-calls-only %s -m %S/Inputs/simple-instrmap.yaml | FileCheck --check-prefixes=RECURSIVE %s3 4---5header:6 version: 17 type: 08 constant-tsc: true9 nonstop-tsc: true10 cycle-frequency: 011records:12# Here we reconstruct the following call trace:13#14# f1()15# f2()16# f3()17# f2()18#19# But we find that we're missing an exit record for f2() because it's20# tail-called f3(). We make sure that if we see a trace like this that we can21# deduce tail calls, and account the time (potentially wrongly) to f2() when22# f1() exits. That is because we don't go back to f3()'s entry record to23# properly do the math on the timing of f2().24#25# As a result, we can deduce that f2() is not recursive here.26#27# Note that by default, tail/sibling call deduction is disabled, and is enabled28# with a flag "-d" or "-deduce-sibling-calls".29#30 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-enter, tsc: 10000 }31 - { type: 0, func-id: 2, cpu: 1, thread: 111, kind: function-enter, tsc: 10001 }32 - { type: 0, func-id: 3, cpu: 1, thread: 111, kind: function-enter, tsc: 10002 }33 - { type: 0, func-id: 3, cpu: 1, thread: 111, kind: function-exit, tsc: 10003 }34 - { type: 0, func-id: 1, cpu: 1, thread: 111, kind: function-exit, tsc: 10004 }35 - { type: 0, func-id: 2, cpu: 1, thread: 111, kind: function-enter, tsc: 10005 }36 - { type: 0, func-id: 2, cpu: 1, thread: 111, kind: function-exit, tsc: 10006 }37...38 39# ALL: Functions with latencies: 340# ALL-NEXT: funcid count [ min, med, 90p, 99p, max] sum function41# ALL-NEXT: 1 1 [ 4.000000, 4.000000, 4.000000, 4.000000, 4.000000] 4.000000 <invalid>:0:0: @(1)42# ALL-NEXT: 2 2 [ 1.000000, 3.000000, 3.000000, 3.000000, 3.000000] 4.000000 <invalid>:0:0: @(2)43# ALL-NEXT: 3 1 [ 1.000000, 1.000000, 1.000000, 1.000000, 1.000000] 1.000000 <invalid>:0:0: @(3)44 45# RECURSIVE: Functions with latencies: 046# RECURSIVE-NEXT: funcid count [ min, med, 90p, 99p, max] sum function47