3 # RUN: llvm-mc -triple=x86_64-windows-msvc -filetype=obj -o %t.obj %s
5 # Test implicit trace file name
6 # RUN: lld-link %t.obj /entry:main /out:%t1.exe --time-trace --time-trace-granularity=0
7 # RUN: cat %t1.exe.time-trace \
8 # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
11 # Test specified trace file name
12 # RUN: lld-link %t.obj /entry:main /out:%t2.exe --time-trace=%t2.json --time-trace-granularity=0
14 # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
17 # Test trace requested to stdout
18 # RUN: env LLD_IN_TEST=1 lld-link %t.obj /entry:main /out:%t3.exe --time-trace=- --time-trace-granularity=0 \
19 # RUN: | %python -c 'import json, sys; json.dump(json.loads(sys.stdin.read()), sys.stdout, sort_keys=True, indent=2)' \
22 # CHECK: "beginningOfTime": {{[0-9]{16},}}
23 # CHECK-NEXT: "traceEvents": [
25 # Check one event has correct fields
33 # Check there are events
34 # CHECK: "name": "Read input files"
36 # Check process_name entry field
37 # CHECK: "name": "lld-link{{(.exe)?}}"
38 # CHECK: "name": "process_name"
39 # CHECK: "name": "thread_name"