Diagnostics: hang watchdog with scoped reports and thread stacks #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Diagnostics"
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?
Base:
master@ab5e4bc. Two commits, 8 files, +817/−0, all authored byagent.Why
A frozen UI needs an actionable local report rather than only a stalled window. This adds the
Diagnosticsmodule and aHangWatchdogthat records what the UI was doing, captures every thread through the mergedCallstack/StackTrace, and leaves a report that can be inspected withgdboreu-stack.How it works
enterPhase(UiPhase)marks idle/input/draw/present;noteInputEvent()counts events handled in the current phase.thresholdMs(2 s by default) creates a report; follow-ups default to 10 s and 30 s, and recovery is appended when the UI moves on.summary.txtis written before thread sampling and contains the stuck phase, input count and open scope trail.threads.txtcontains repeated per-thread stack samples with name, scheduler state and kernel wait channel.allowDebuggerAttach()permits same-user debuggers on Linux.$HOME/<process>/hangs, overridden byMODULES_HANG_DIR.UiTrailis private to Diagnostics, and the directory logic is local, so there is noAppStoragedependency. The tests drive the trail directly instead of depending on the profiler.Verification
Built the library and test executable locally and ran the UnitTest++ suite:
The root build registers
add_subdirectory(Diagnostics). Tests are always built as on current master; noMODULES_BUILD_TESTSgate is introduced.Closed:
GraphicApplicationis the watchdog's only consumer, so this logic belongs to the application layer.HangWatchdogandUiTrailmoved into the local Graphics branch ine585c14; the standalone Diagnostics module is dropped. All 9 watchdog tests still pass.Pull request closed