The problem: Real-time control loops — robot joint controllers, infusion pumps, vehicle ECUs — are only as good as their worst-case wakeup latency. A periodic task that is on time on average can still miss the one deadline that matters. Developers need a small, trustworthy tool that runs on the target itself and shows the full latency distribution, not a reassuring mean.

What PulseWatch does: PulseWatch is a C tool that runs a periodic loop on a QNX 8.0 target and, for every period, records the delay between the scheduled wakeup and the actual wakeup. It reports min / mean / standard deviation, p50 / p99 / p99.9 / max latency, a latency histogram (1 µs – 1 ms buckets), a deadline-miss count, and optional per-sample CSV export. Options: --period-us, --samples, --priority, --csv.

How it uses QNX: A periodic timer created with timer_create() delivers a pulse (SIGEV_PULSE_INIT) to a private channel every period; the worker blocks in MsgReceivePulse() — QNX microkernel message passing drives the measurement loop (src/backend_qnx.c). Timestamps come from ClockCycles(), converted with the system page's cycles_per_sec using a 128-bit intermediate. The pulse carries a priority, so QNX's priority-driven preemptive scheduler schedules the measurement at the same priority a real control loop would run at. A POSIX backend (clock_nanosleep) implements the same measurement for Linux development; every report names its backend.

Build & run: QNX SDP 8.0 (qcc, GCC 12). make qnx produces ./pulsewatch-qnx via genuine qcc. The binary is baked into a bootable QEMU image with mkqnximage using two snippets shipped in the repo (qnx/snippets/): ifs_files.90.pulsewatch adds the binary as /proc/boot/pulsewatch; post_start.90.pulsewatch runs it at boot between the markers '=== PulseWatch vendor mkqnximage run ===' and '=== PulseWatch finished ==='.

Verified run: On 2026-12-03 the image was booted on a Windows host; QNX 8.0.0 (x86_64) started fully ('Startup complete') and PulseWatch executed end to end. The full serial log is in the repo at docs/qemu-boot-log-windows.txt.

Honest caveat: The verified run used QEMU's TCG software emulation without hardware acceleration, which dilates ClockCycles() timing (the captured log's mean latency reads ≈11.79 s against a 1 ms period). The run proves PulseWatch builds with the genuine SDP 8.0 toolchain, boots, and executes correctly on QNX 8.0 — the timing values from an unaccelerated emulator are not representative of hardware and are not presented as performance results.

What's next: Priority sweeps, multi-period profiles, JSON output, and a hardware run on a physical QNX target to publish true worst-case figures.

Built With

  • c
  • gcc-12
  • mkqnximage
  • qcc
  • qemu
  • qnx
  • qnx-neutrino-8.0
  • qnx-sdp-8.0
  • sdp
Share this project:

Updates

Submission history