What it does
qnx-trace-lens is a host-side scheduling analyzer for QNX 8.0 kernel traces. It parses traceprinter output from tracelogger captures, computes per-thread CPU time, ready-queue wait and blocking time, detects priority inversions (a high-priority thread waiting on a lock while a middle-priority thread runs), and renders an HTML report with an SVG timeline. It exits non-zero when inversions exceed a threshold, so it can gate CI. It ships with rt-pulse, a small C workload app for QNX 8.0 that reproduces a classic priority-inversion scenario (a low-priority thread holding a mutex in a critical section, a medium-priority thread spinning, a high-priority thread blocked on the mutex), with and without priority inheritance. Validated on real traces captured from a QEMU guest running QNX 8.0 (mkqnximage image, SSH into the guest, tracelogger -w): on 1 CPU, 40 priority inversions without priority inheritance vs 0 with it; on 2 CPUs, 25 vs 11. The repository includes the real .kev captures, the traceprinter text, and the generated HTML reports, plus a self-test suite (14/14 pass) and a build script that re-validates all four traces.
How I built it
Python (stdlib only) analyzer plus a C workload app compiled with qcc for QNX 8.0, running in a QEMU guest (mkqnximage image, SSH on localhost:2222). Traces captured with tracelogger -w and analyzed with trace_lens.py.
Challenges I ran into
Getting the QEMU guest to boot and accept SSH took eight rounds: missing libraries (libgcc_s, libsecpol, libfsnotify, libqh, pipe), an sshd that segfaulted when daemonized, and PAM breaking pubkey auth. Each was found by reading the guest's own logs and fixed in the image templates.
Accomplishments that I'm proud of
A clean end-to-end demo on real traces: 40 inversions without priority inheritance, 0 with it on one CPU — plus a validated build script that re-checks all four captured traces.
What I learned
How QNX 8.0 boots in QEMU, how the microkernel schedules threads, and how tracelogger and traceprinter expose scheduling events.
What's next
Support for more QNX trace event classes, a live mode that streams tracelogger output, and packaging as a QNX host tool.