Files
reims-vgpu/scripts/qemu-thread-census
Anees Iqbal a37c4f6cdc ✨ A per-thread CPU census of QEMU, because every counter this device emits measures this device
A driven boot of the WebGL dial produces six frames a second with the drain
worker's duty at 0.12. The fail log can say the device was idle seven eighths of
the time and cannot say who held the other seven eighths — a computing guest, a
vCPU spinning on a device register, and everyone asleep waiting on a round trip
all read identically there, and only one of the three is this device's bug.

QEMU names its threads, so a `/proc/<pid>/task` census separates them: a hot
`CPU n/KVM` is the guest computing, a hot `qemu-main` with a cold drain is a
guest blocked in a register write the shim handles inline, and four cold threads
against a full wall clock is a latency problem rather than a throughput one.

Costs two `/proc` reads a second. Written as its own script rather than inside a
probe because it works for any workload; `gpu-load-probe` runs it for the length
of its window.

Verified: parses and reports on a live process on the host (the field-14/15 read
counts back from the end of the line, so a thread whose name contains a space
does not shift it). Not yet run against a boot.
2026-08-11 13:46:15 +03:00
..