This document describes the tools and frameworks used to analyze, debug, and validate openpilot behavior through log inspection and replay. These tools enable developers to investigate issues, validate changes, and perform regression testing using recorded driving data.
For information about the Cabana CAN analysis GUI tool, see Cabana CAN Analysis Tool. For information about the broader testing framework, see Testing Framework Overview and Process Replay Testing.
The openpilot debugging toolkit provides several complementary capabilities for inspecting both real-time and recorded data:
| Tool | Purpose | Use Case |
|---|---|---|
dump.py | Real-time message inspection | Live debugging of running processes and sockets |
LogReader | Log access API | Python interface for reading rlog/qlog files |
replay | C++ route playback | Simulating driving sessions with full UI/video |
juggle.py | Time-series visualization | Plotting signals from logs using PlotJuggler |
jotpluggler | Next-gen visualization | High-performance C++ based time-series plotting |
filter_log_message.py | Log filtering | Isolating specific logMessage or errorLogMessage entries |
Sources: tools/scripts/dump.py28-37 tools/plotjuggler/juggle.py132-143 tools/scripts/filter_log_message.py48-53 openpilot/tools/jotpluggler/sketch_layout.cc34-43
The dump.py script provides real-time inspection of cereal messages flowing through the messaging infrastructure. It uses raw_live_logreader to subscribe to ZMQ/MSGQ sockets and can output data in various formats. tools/scripts/dump.py9-10 tools/scripts/dump.py39-45
hexdump(msg). tools/scripts/dump.py14-23--dump-json to export the full Cap'n Proto event as a dictionary via evt.to_dict(). tools/scripts/dump.py55-56--values flag allows monitoring specific nested fields (e.g., carState.vEgo) instead of the entire event. tools/scripts/dump.py57-64This utility specializes in extracting human-readable logs produced by SwagLogger. It filters logMessage, errorLogMessage, and operatingSystemLog services. tools/scripts/filter_log_message.py64-69
LogReader. tools/scripts/filter_log_message.py57-60operatingSystemLog to identify the source (MAIN, KERNEL, SYSTEM, etc.). tools/scripts/filter_log_message.py16-23Sources: tools/scripts/dump.py1-75 tools/scripts/filter_log_message.py1-80
juggle.py is the current wrapper for PlotJuggler, including an automated installation script that downloads prebuilt binaries for Linux and macOS. tools/plotjuggler/juggle.py43-62
carParams and loads the corresponding DBC via generate_dbc_dict. tools/plotjuggler/juggle.py117-124migrate_all on log data before loading. tools/plotjuggler/juggle.py112-113JotPluggler is the high-performance C++ successor. It features:
LogReader and py_downloader.h to fetch segments. openpilot/tools/jotpluggler/sketch_layout.cc27-28generated_event_extractors.h for efficient Cap'n Proto field extraction. openpilot/tools/jotpluggler/sketch_layout.cc94CerealLocal (MSGQ) and CerealRemote (ZMQ) sources. openpilot/tools/jotpluggler/layout.cc26-36Title: JotPluggler Architecture
Sources: tools/plotjuggler/juggle.py1-170 openpilot/tools/jotpluggler/sketch_layout.cc34-106 openpilot/tools/jotpluggler/layout.cc118-153
The replay system is complemented by a Python-based ui.py for debugging specific control signals and model outputs.
This tool provides a multi-pane visualization using pyray (Raylib) to display:
CameraView. openpilot/tools/replay/ui.py60v_ego, steeringAngleDeg, gas, and accel actuators. openpilot/tools/replay/ui.py96-127The UI thread maintains a SubMaster to synchronize messages including carState, longitudinalPlan, carControl, and modelV2. openpilot/tools/replay/ui.py73-88 It uses a Calibration class to project 3D model paths onto the 2D camera frame. openpilot/tools/replay/ui.py200-202
Sources: openpilot/tools/replay/ui.py1-208 openpilot/tools/replay/SConscript1-108
Monitors hardware performance by subscribing to deviceState and procLog. tools/scripts/live_cpu_and_temp.py37
cpuTimes across updates. tools/scripts/live_cpu_and_temp.py58-75--cpu or --mem, it identifies the top 10 processes by resource consumption, resolving names via proc_name. tools/scripts/live_cpu_and_temp.py77-103Analyzes a qlog to provide a summary of a drive's events.
onroadEvents (e.g., lane departures, FCW). tools/scripts/count_events.py29-35SERVICE_LIST. tools/scripts/count_events.py62-66selfdriveState alert. tools/scripts/count_events.py37-41Title: Debug Script Data Sources
Sources: tools/scripts/live_cpu_and_temp.py1-107 tools/scripts/count_events.py1-78 tools/scripts/mem_usage.py
Refresh this wiki