What it does

DeadlineScope is a Linux host tool for QNX 8.0 developers. It reads a scheduling trace exported from a QNX target and reports two classes of real-time faults with timestamped evidence: deadline misses (a periodic job that finishes after its period, with the exact overrun in milliseconds) and priority inversion (a high-priority thread blocked on a mutex held by a lower-priority thread while a mid-priority thread runs, naming the threads and the mutex involved). For each thread it also reports job count, miss count, and worst and average response time. The tool exits non-zero when faults are found, so it can gate a CI pipeline, and it can emit text, JSON, or HTML reports.

How we built it

The analyzer is a single dependency-free Python 3 program (deadlinescope.py) that parses a simple CSV trace format (time_ms, thread, event, detail) and reconstructs job releases, completions, and mutex hold/wait intervals. The repository also ships a QNX 8.0 target demo (target/qnx_demo.c) that runs three SCHED_FIFO threads — control at priority 40, telemetry at 20, logger at 10 — where the logger holds a bus mutex long enough to create a genuine priority inversion. The demo builds with qcc -Vgcc_ntox86_64 from QNX SDP 8.0 (Makefile target qnx), and the same source builds on the host for trace generation. Two sample traces (faulty and clean) plus five unit tests cover the detection logic.

Challenges we ran into

Reproducing a priority inversion deterministically requires the low-priority thread to hold the mutex across the high-priority thread's release; we tuned the demo's timing so the inversion appears on every run. On the tooling side, installing QNX SDP 8.0 headlessly was a challenge: the SDP is delivered only through QNX Software Center, which requires an interactive desktop login, so we validated the target source with the host build and kept the QNX build as a one-command step (make qnx) for machines with the SDP installed.

Accomplishments that we're proud of

A fault report that points at evidence, not vibes: every finding names the thread, the timestamps, and the measured overrun, and the clean trace produces a CLEAN verdict with exit code 0. The analyzer caught both seeded faults in the demo trace (a 3.000 ms deadline miss and the bus-mutex inversion) with zero configuration.

What we learned

Timing faults are invisible in code review; they only exist in the schedule. A small, strict trace format plus interval reasoning is enough to surface them automatically, and a CI-friendly exit code turns that analysis into a regression gate.

What's next for DeadlineScope

Parse native QNX tracelogger output directly, add response-time histograms to the HTML report, and run the target demo in QEMU under QNX 8.0 as part of CI once a headless SDP install path is available.

Built With

  • 8.0
  • c
  • linux
  • mutexes
  • posix
  • pthread
  • python
  • qcc
  • qnx
  • sched-fifo
  • sdp
  • threads
Share this project:

Updates

Submission history