Repository navigation
tv-sched-trace: bounded trace_pipe read-back, and what the 2026-10-02 back-buffer-wait capture showed - #377
Merged
Merged
Conversation
… size the ring, add --tid The first TV run read the non-consuming `trace` file, which re-walks the ring on every read: after nine minutes 85k of 868k buffered events had arrived. The ring had also overrun at 20 s (1.32 M written, 868 k kept, CPU 0's early events gone), the events were a third arch_timer noise, and no syscall events were enabled for the analyser. The read-back now drains trace_pipe on the set (gzipped there), ends when the per-CPU stats show an empty buffer, and is bounded on the host by --read-timeout (default 90 s). A stopped read-back (the timeout or ^C) asks the set to end the drain, keeps what arrived as a valid gzip, says how many seconds it covers and exits 3 (130 on ^C). Entries/overrun are printed before the drain. The arch timer is filtered out of irq_handler_entry/exit (string filter, falling back to /proc/interrupts numbers). --secs defaults to 8 and the ring is sized for ~60k events/s capped at 32 MB across CPUs. --tid N enables raw_syscalls filtered to that thread. Restore clears the filters, disables the syscall events and kills any reader left on the set. tools/test_tv_sched_trace.py drives the script against a fake tracefs (trace_pipe is a FIFO) and a fake tv-ssh, and is wired into check-python. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… device facts Replaces the "next TV session" framing of the three legs with the results: the GPU is idle during the long waits, osd_irq paces commits at 8.33 ms, most long waits follow an on-time commit and are the compositor's, the frame thread's preemption is small, the text prewarm drain was unbounded, the #372 preload did not drop a frame, and the Wayland debug leg printed nothing on this firmware. Corrects the open-frame figure quoted from before #372 and the claim that the probe's run-queue field reads 0. tv-sched-trace.sh's header now states what was observed on the 4.4.84 kernel and recommends --secs 6; no behaviour change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 2, 2026
A simplify pass over #376 and #377, with the review follow-ups from #376. The background prewarm drain now runs only when the live drain leaves at least BACKGROUND_MIN_US (1 ms) of the 2.5 ms budget, so a sliver does not buy a whole parked string; a host test covers the sliver and the empty-live-queue case. Stale "one string a frame" and "six-millisecond" comments in text.rs and track_menu.rs describe the time-budgeted drain. tv-sched-trace.sh defaults to --secs 6 (the measured loss-free length on the 4.4.84 kernel), its usage() prints the usage line, and the ring sizing names its event rate and size. Its test has one env builder, one clock constant and one ps per pid. docs/player-submenus.md agrees on the default and records the measured effect of #376. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The tool. The first run of
tools/tv-sched-trace.shon the television stalled in its read-back: it read the non-consumingtracefile, which re-walks the ring on every read on the 4.4.84 kernel, so 3.3 s of data took about nine minutes. The ring had also overrun, a third of the events were arch-timer noise, and no syscall events were enabled for the analyser.trace_pipeon the set (gzipped there), ends when the per-CPU stats show an empty buffer, and is bounded on the host by--read-timeout(default 90 s). A stopped read-back keeps what arrived as a valid gzip and says how many seconds it covers.--tid Nenablesraw_syscallsfor that thread, so the analyser can see what the frame thread blocks in.tools/test_tv_sched_trace.pydrives the script against a fake tracefs and a faketv-ssh, wired intomake check-python.The findings.
docs/player-submenus.mdreplaces the "next TV session" plan with what the capture showed (build 6ee274c, guest profile, mock server, player with the track menu and sub-menu oscillator):GPU_ACTIVEis the same 6.6 M cycles in 20–24 ms frames as in 16–20 ms frames, against a ~10.6 M budget.osd_irqfires every 8.33 ms. The frame thread blocks inpollinside its first framebuffer command, is woken just after an interrupt, and normally commits 4.3–5.1 ms before the next one. A commit after that interrupt costs the next frame a full extra 16.7 ms.WAYLAND_DEBUG=clientprinted nothing on this firmware; thewldebugleg is a dead instrument there.Verification
make check-pythonon the committed tree:analyze-sched-trace self-test: ok;Ran 4 tests in 12.520s/OK(the new suite);Ran 371 tests in 120.531s/OK.shellcheckandbash -nclean.--tidreturned 433,702 events; only CPU 0 overran (5,644 of 166,017), which is why the doc recommends--secs 6.No Rust or C changes.
🤖 Generated with Claude Code