qnx-kev-mcp-inspector
QNX 8.0 Kernel Trace & IPC Inspector (qnx-kev-mcp-inspector)
Deterministic host-side kernel trace (.kev / traceprinter) analyzer, interactive multi-CPU oscillograph studio, and Model Context Protocol (MCP) server for QNX Neutrino RTOS / SDP 8.0.
Live Interactive Visual Studio: https://z121245017-ai.github.io/qnx-kev-mcp-inspector/
60-Second Full HD (1080p) Demo Video: https://z121245017-ai.github.io/qnx-kev-mcp-inspector/demo.mp4
15-Minute Hands-On QNX 8.0 Codelab:
docs/CODELAB.md
Why We Built This
Debugging real-time concurrency bugs on QNX SDP 8.0 (STATE_REPLY callback deadlocks, _NTO_CHF_FIXED_PRIORITY priority inversions, and Adaptive Partitioning Scheduler APS jitter) traditionally requires manually sifting through tens of thousands of traceprinter lines or loading heavy desktop GUI profilers that AI coding agents cannot read.
qnx-kev-mcp-inspector bridges QNX SDP 8.0 kernel instrumentation (tracelogger / traceprinter), deterministic graph & real-time scheduling math, and modern AI developer workflows (Claude Code, Cursor, VS Code Copilot) with zero external runtime dependencies:
flowchart LR
Target["QNX SDP 8.0 Target\ntracelogger -> .kev / traceprinter"] --> Parser["Multi-Format Parser\n(.trace | qnx-trace-v1 | QNXKEV80)"]
Parser --> A1["1. IPC & Mutex Deadlock\nTarjan SCC + Johnson Cycles"]
Parser --> A2["2. Priority Inversion\n_NTO_CHF_FIXED_PRIORITY Math"]
Parser --> A3["3. Hard-RT WCET & IST\np50/p95/p99 + APS + Pulses"]
A1 & A2 & A3 --> A4["4. SDP 8.0 C Patch Advisor\nSIGEV_PULSE / ChannelCreate / APS"]
A4 --> Studio["Self-Contained Web Studio\ndocs/index.html"]
A4 --> MCP["MCP Server (stdio & HTTP/SSE)\nsrc/mcp-server.mjs"]Related MCP server: DebugForge
Core Capabilities
1. Three Native Input Formats + Lossless Binary .kev Round-Trip
Authentic QNX
traceprinterLogs: ParsesTRACE_CYCLES_PER_SEC,PROCCREATE_NAME,THCREATE,THRUNNING/THREADY/THSEND/THRECEIVE/THREPLY/THMUTEX/THNANOSLEEP/THINTR,MSG_SENDV/11,MSG_RECEIVEV/14,MSG_REPLYV/15,MSG_SEND_PULSE/17,CHANNEL_CREATE/35,CONNECT_ATTACH/37,INT_ENTR, andAPS_PARTITION.Structured
qnx-trace-v1JSON / NDJSON Streams: Clean programmatic trace exchange for CI regression gates.Binary
QNXKEV80.kevCodec (src/kev-codec.mjs): Packed 32-byte binary event frames with symbol table and CRC32 integrity verification—works identically in Node.js and the browser (Uint8Array/DataView).
2. Four Deterministic QNX 8.0 Diagnostic Analyzers
Synchronous IPC & Mutex Deadlock Detector (
src/analyzers/deadlock.mjs): Reconstructs live(pid, tid) -> chid -> (server_pid, server_tid)edges acrossSTATE_SEND,STATE_REPLY, andSTATE_MUTEX, running Tarjan SCC + Johnson minimal elementary cycle extraction to pinpoint multi-processMsgSend()callback rings.**Unbounded Priority Inversion Detector (
src/analyzers/priority-inversion.mjs):**Integrates exact microsecond slices where a high-prioritySCHED_FIFOthread (prio >= 50) blocks inSTATE_REPLYorSTATE_MUTEXwhile a medium-priority thread preempts an unboosted server (_NTO_CHF_FIXED_PRIORITYonChannelCreate()or missingPTHREAD_PRIO_INHERIT).Hard Real-Time WCET & IST Latency Auditor (
src/analyzers/wcet-latency.mjs): Computesp50/p95/p99/maxREADY -> RUNNINGdispatch latency,InterruptAttachEvent(IRQ_ENTER -> THRUNNING) response latency, handler WCET overruns,APSpartition budget exhaustion, and QNX pulse queue saturation (SND_PULSE_DIS/EAGAIN).Idiomatic QNX SDP 8.0 C Patch Advisor (
src/analyzers/remediation.mjs): Synthesizes ready-to-apply C diffs usingSIGEV_PULSE_INIT,MsgRegisterEvent,MsgDeliverEvent,ChannelCreate(_NTO_CHF_DISCONNECT | _NTO_CHF_UNBLOCK), andSchedCtl(SCHED_APS_MODIFY_PARTITION, ...).
3. Interactive Single-Page Oscillograph Studio (docs/index.html)
Zero CDN / Zero External Requests: Runs offline from
file://or GitHub Pages.Multi-CPU & Per-Thread Timeline Swimlanes + State Flamebars with
1x–8xzoom, cycle/microsecond crosshair ruler, and anomaly overlays.Interactive SVG Wait-For & Channel Topology Graph highlighting minimal deadlock cycles in red.
1-Click Fixture Loader + drag-and-drop
.trace/.json/.kevupload + in-browser.kevbinary export & CRC32 round-trip verifier.
Quick Start
git clone https://github.com/z121245017-ai/qnx-kev-mcp-inspector.git
cd qnx-kev-mcp-inspector
# Run the full test suite (Node.js >= 20 built-in test runner, 0 npm install needed)
npm test
# Inspect all 4 realistic QNX 8.0 embedded trace fixtures
node bin/qnx-inspector.mjs analyze adas_ipc_deadlock
node bin/qnx-inspector.mjs analyze ventilator_prio_inversion
node bin/qnx-inspector.mjs analyze industrial_ethercat_jitter
node bin/qnx-inspector.mjs analyze healthy_baseline
# Encode a traceprinter log into a binary .kev capture and decode back
node bin/qnx-inspector.mjs kev-encode fixtures/adas_ipc_deadlock.trace -o /tmp/adas.kev
node bin/qnx-inspector.mjs kev-decode /tmp/adas.kev --to traceprinter | head -n 20Included QNX 8.0 Embedded Trace Fixtures (fixtures/)
Fixture | Domain Scenario | Deterministic Finding |
| 3-process ADAS emergency braking ( |
|
| ICU ventilator |
|
|
|
|
| Remediated dual-core QNX 8.0 reference capture |
|
Model Context Protocol (MCP) Server Setup
src/mcp-server.mjs implements JSON-RPC 2.0 over stdio (both newline-delimited and Content-Length framed) plus optional HTTP/SSE (--http 3848).
Claude Code / Cursor / VS Code (.mcp.json)
{
"mcpServers": {
"qnx-kev-inspector": {
"command": "node",
"args": ["/path/to/qnx-kev-mcp-inspector/src/mcp-server.mjs"]
}
}
}Docker (Zero-Network Alpine Image / Glama Ready)
{
"mcpServers": {
"qnx-kev-inspector": {
"command": "docker",
"args": ["run", "-i", "--rm", "qnx-kev-mcp-inspector"]
}
}
}Exposed MCP Tools, Prompts & Resources
Tools (
readOnlyHint: true, strict JSON Schemas):inspect_qnx_trace— Complete diagnostic report, flame breakdown, and QNX SDP 8.0 C patches.detect_ipc_deadlocks— Minimal Tarjan/Johnson Wait-For cycles andMsgDeliverEventpulse patches.audit_priority_inversions— Microsecond preemption windows and_NTO_CHF_FIXED_PRIORITY/ mutex PI audit.audit_wcet_deadlines— Per-thread/ISTp50/p95/p99/maxdispatch latency, WCET budget, APS, and pulse queue audit.
Prompts:
diagnose-qnx-deadlock-and-inversion,audit-qnx-hard-rt-wcetResources:
qnx://reference/neutrino-constantsplus all 4 embedded QNX 8.0 trace fixtures (qnx://fixtures/{fixtureName}).
Repository Structure
qnx-kev-mcp-inspector/
├── bin/
│ └── qnx-inspector.mjs # CLI analyzer, .kev encoder/decoder, MCP launcher
├── docs/
│ ├── index.html # 100% self-contained single-page Visual Studio (0 CDN deps)
│ ├── demo.mp4 # 60s 1080p Full HD narrated walkthrough (-15.1 LUFS)
│ └── CODELAB.md # 15-minute QNX SDP 8.0 hands-on tutorial
├── fixtures/ # 4 realistic QNX 8.0 .trace captures + binary .kev fixture
├── scripts/
│ ├── generate-fixtures.mjs # Deterministic nanosecond/cycle fixture builder
│ ├── build-studio.mjs # Bundles src/ + fixtures/ into docs/index.html
│ └── render-demo-video.mjs # Headless Chrome CDP + FFmpeg 60s 1080p video renderer
├── src/
│ ├── qnx-constants.mjs # <sys/states.h>, <sys/neutrino.h>, <sys/trace.h> constants
│ ├── kev-codec.mjs # Lossless QNXKEV80 binary encoder/decoder + CRC32
│ ├── parser.mjs # Multi-format parser (traceprinter, JSON, binary .kev)
│ ├── index.mjs # Unified inspectTrace() + swimlane/flamebar builder
│ ├── mcp-server.mjs # Standard MCP Server (stdio + HTTP/SSE)
│ └── analyzers/
│ ├── deadlock.mjs # Tarjan SCC + Johnson minimal IPC/mutex cycle detector
│ ├── priority-inversion.mjs # Unbounded priority inversion & channel flag auditor
│ ├── wcet-latency.mjs # Hard-RT WCET, IST latency, APS & pulse queue auditor
│ └── remediation.mjs # Idiomatic QNX SDP 8.0 C unified diff generator
└── tests/
└── qnx-inspector.test.mjs # >= 28 end-to-end deterministic & MCP protocol testsLicense
Released under the MIT License.
Available Tools
4 toolsaudit_priority_inversionsARead-onlyIdempotent
Detect unbounded priority inversions where high-priority SCHED_FIFO threads block in STATE_REPLY or STATE_MUTEX while medium-priority threads preempt unboosted servers (_NTO_CHF_FIXED_PRIORITY or missing PTHREAD_PRIO_INHERIT).
Inputs: kevBase64, tracePath, minHighPrio, traceContent.
audit_wcet_deadlinesBRead-onlyIdempotent
Compute p50/p95/p99/max READY->RUNNING scheduling latency, Interrupt Service Thread (IST) response times, handler WCET overruns, APS partition budget starvation, and QNX pulse queue saturation.
Inputs: kevBase64, tracePath, traceContent.
detect_ipc_deadlocksBRead-onlyIdempotent
Reconstruct the live QNX Neutrino (pid, tid) -> chid -> owner_pid Wait-For Graph across STATE_SEND, STATE_REPLY, and STATE_MUTEX, extracting minimal Tarjan/Johnson deadlock cycles and MsgDeliverEvent/SIGEV_PULSE fixes.
Inputs: kevBase64, tracePath, traceContent.
inspect_qnx_traceBRead-onlyIdempotent
Run all 4 deterministic QNX SDP 8.0 analyzers (IPC deadlock cycles, unbounded priority inversions, hard-RT WCET/IST p99 deadlines, and C remediation patches) on a traceprinter log, JSON trace, or binary .kev capture.
Inputs: kevBase64, tracePath, minHighPrio, traceContent.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Three tools cleanly map to distinct analysis domains (deadlock, priority inversion, WCET), and inspect_qnx_trace is explicitly documented as running all analyzers plus remediation. The only overlap is that the aggregate is a superset of the other three, so an agent must decide between run-all versus drill-down, but descriptions make that choice clear.
All names are snake_case verb_noun constructions, which is consistent and predictable. The verbs vary (inspect/detect/audit) rather than following one canonical verb, but each choice reads naturally for its action.
Four tools is a tight, focused surface for a trace-inspection server, and the aggregate-plus-three-analyzers structure is well scoped. It sits at the thin end of the ideal range, with the aggregate arguably duplicating the other three.
The core analysis domain (deadlocks, priority inversion, WCET, remediation) is covered, but there are notable gaps: no standalone remediation/patch tool despite patches being advertised, and no trace discovery/validation, report export, or trace comparison operations. Agents hitting a non-parseable or unsupported trace format have no fallback path.
Maintenance
Related MCP Connectors
LLM Orchestration Observability Agent
LLM Orchestration MCP Agent
AgentQ MCP Server - AI-Powered Software Quality Assurance Platform
LLM Observability & Orchestration Agent
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server analyzing Windows ETW (.etl) traces — 54 tools spanning CPU/wait stacks, image-load gaps, file/disk/mmap I/O, VirtualAlloc, network, registry, ALPC, DPC/ISR, CLR (GC/JIT/alloc/exception/contention), NT heap, and any user-mode ETW provider. Domain-neutral; works on any Windows trace.18Apache 2.0
- AlicenseAqualityCmaintenanceMCP server bridging Lauterbach TRACE32 debuggers to AI agents for autonomous debugging, providing 47 tools for execution control, breakpoints, memory, registers, variables, and symbol inspection.1010014MIT
- AlicenseBqualityCmaintenanceThis MCP server has been deprecated and deleted.2MIT
- AlicenseAqualityCmaintenanceTamper-Evident Autonomous Agent Action Audit & Governance Logging MCP Server213 npmMIT