tools: log thread ids and per-thread gaps in traced calls #3501
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3501
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3499"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Leyukaka on GitHub · 2026-11-29 18:19 UTC · original
Leyukaka:tools-trace-thread-ids→main· +319 −36 · 10 files · 8 commits · draftRefs #3479 (item 8, #3479).
Stacked on #3465: until it merges, this PR also shows its commit. The change here is the last two commits,
23fa52f8and9699aa4f(head).Why
In a long local run of the application, the trace could not say which thread stopped issuing work before the stop.
What changes
tools/startup/debug_launch.py: return lines of runtime and movie-player calls (--trace-calls) infiles.txtend withtid=<id> gap_ms=<ms|n/a>. File-hook lines (NtCreateFile,NtOpenFile, ...) keep their format.tools/startup/hook_window.py: newtrace_call_suffix. The gap is per thread, fromtime.monotonic(), between that thread's logged trace lines, in ms with 3 decimals. The first line of a thread hasgap_ms=n/a.Exception and debugger stop lines in
events.txtend withtid=<id>.tools/startup/triage_run.py,tools/startup/exit_report.py: the debugger stop regex accepts the optionaltid=suffix, with the same captures. The exception regexes are not end-anchored and needed no change.live_view.pyand the other consumers of these lines are unaffected.Tests
tests/startup_hook_check.py,tests/startup_triage_run_check.py,tests/startup_exit_report_check.py: pass.cmake --preset dev -DX2W_WITH_OPUS:BOOL=OFF, build targetsstartup_debug_probeandstartup_debug_calls, thenctest -R '^startup_debug(_log|_hooks)?$': 3/3 passed.Mutations, each caught by a failing check:
trace_call_suffixstartup_hook_checktid=dropped from the exception linestartup_debugtriage_run.pystartup_triage_run_checkexit_report.pystartup_exit_report_checkstartup_debug_hookstid=dropped from the debugger stop linestartup_debugstartup_debug_hooks(a new thread reusing the exited thread's id gets a numeric gap instead ofn/a)docs/startup-runtime.mddescribes thetidandgap_msfields.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.