upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tools/boot_trace.py
diff options
context:
space:
mode:
authorSuarezPM <SuarezPM@users.noreply.github.com>2026-11-22 15:58:29 -0300
committerSuarezPM <SuarezPM@users.noreply.github.com>2026-11-22 15:58:29 -0300
commitefcd434cfcbc3780d5de25a5e18ee4823dc2636c (patch)
treec47c7232924b53255d1673569cb3b1e3bf26da44 /tools/boot_trace.py
parentbd6e3afa68a6c4bdfb9dc8ac76a941830275f2f8 (diff)
boot: keep the first D3D12 call from a PowerShell 5.1 log
PowerShell 5.1 wraps the first stderr line of a native program in an error record: `d3d12_test.exe : [d3d12-trace] #1 ...`. The anchored tag match counted that line as noise, so the summary lost call #1 and still exited 0. The tag may now follow a `<name> : ` prefix; a fixture and a dedicated test keep it. docs/boot.md says the prefix is accepted and that the BOM from Out-File -Encoding utf8 is stripped.
Diffstat (limited to 'tools/boot_trace.py')
-rw-r--r--tools/boot_trace.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/boot_trace.py b/tools/boot_trace.py
index 47d167781..bebf34bd0 100644
--- a/tools/boot_trace.py
+++ b/tools/boot_trace.py
@@ -7,7 +7,9 @@ triage needs: modules, unimplemented calls and their callers, DllMain/TLS result
7the D3D12 calls by outcome and the first call per method. 7the D3D12 calls by outcome and the first call per method.
8 8
9The method field can contain spaces (`SetMarker/BeginEvent with unknown metadata`), so the parser takes the 9The method field can contain spaces (`SetMarker/BeginEvent with unknown metadata`), so the parser takes the
10outcome as the last field instead of assuming a single-word method. 10outcome as the last field instead of assuming a single-word method. PowerShell 5.1 wraps the first stderr line of
11a native program in an error record (`program.exe : [d3d12-trace] #1 ...`), so a `<name> : ` prefix before the
12tag is accepted too; without it the first call of the run would be lost.
11 13
12Usage: 14Usage:
13 python -I boot_trace.py boot.jsonl [--d3d12 d3d12.log] [--json] [--limit N] 15 python -I boot_trace.py boot.jsonl [--d3d12 d3d12.log] [--json] [--limit N]
@@ -27,7 +29,7 @@ import json
27import re 29import re
28import sys 30import sys
29 31
30D3D12_LINE = re.compile(r"^\[d3d12-trace\] #(\d+) (.+) (\S+)\s*$") 32D3D12_LINE = re.compile(r"^(?:.+ : )?\[d3d12-trace\] #(\d+) (.+) (\S+)\s*$")
31 33
32 34
33class TraceError(ValueError): 35class TraceError(ValueError):