Find a priority inversion on QNX in 20 minutes

A brake controller on QNX misses a third of its deadlines. Its code looks fine, its priorities look right, and the bug only shows up when three threads line up in time. In this codelab you will catch it the way real-time engineers do: record what the kernel did, then read the trace. Latency Lens does the reading for you.

What you'll do

  • Build a small, deliberately buggy brake controller for QNX OS 8.0 with qcc.
  • Boot QNX OS 8.0 in QEMU and record a kernel event trace with tracelogger.
  • Open the trace in Latency Lens, which finds the deadline misses and the priority inversion behind them, with the exact kernel events as evidence.
  • Optionally ask an LLM to explain the finding, with every number it writes checked against the trace.
  • Fix the bug with a priority-inheritance mutex, capture again and prove the fix.

What you'll learn

  • What a QNX kernel trace records: thread states, priorities, kernel calls, interrupts and messages.
  • How a priority inversion looks on a timeline, and why PTHREAD_PRIO_INHERIT fixes it.
  • How to tell a scheduling bug from platform latency, and how to gate CI on deadlines.

What you'll need

  • A Linux x86_64 machine (a VM or container works; KVM is used when present, otherwise QEMU emulates).
  • A free myQNX account with a QNX SDP 8.0 non-commercial license.
  • Node.js 20 or newer and pnpm, git, QEMU and an ssh client.