How rostedt/trace-cmd works
trace-cmd is a Linux tracing toolkit and libtracecmd library. Its central workflow configures kernel tracing, records events to trace.dat, then reads and analyzes the resulting trace. The tree also documents command-line tools, Python interfaces, and live-agent/network support. The graph links only relationships visible in excerpts or explicitly documented by the README; other command-dispatch and analysis relationships are left unconnected where source was not shown.
Main entry points: trace-input.c Trace reader · trace-record.c Record tracing · trace-compress.c Compression · tracecmd.py Python interface
Components 25
Capture and transport
- Record tracing
tracecmd/trace-record.c - Trace agent
tracecmd/trace-agent.c - Live listener
tracecmd/trace-listen.c - Message transport
lib/trace-cmd/trace-msg.c - Clock synchronization
lib/trace-cmd/trace-timesync.c - PTP synchronization
lib/trace-cmd/trace-timesync-ptp.c
Trace file library
- Trace writer
lib/trace-cmd/trace-output.c - Trace reader
lib/trace-cmd/trace-input.c - Compression
lib/trace-cmd/trace-compress.c - Zlib backend
lib/trace-cmd/trace-compress-zlib.c - Zstd backend
lib/trace-cmd/trace-compress-zstd.c - Library API
include/trace-cmd/trace-cmd.h - trace.dat
Trace analysis
- Trace profiling
tracecmd/trace-profile.c - Trace reading
tracecmd/trace-read.c - Event histograms
tracecmd/trace-hist.c - SQL histograms
tracecmd/trace-sqlhist.c - Trace statistics
tracecmd/trace-stat.c - Trace splitting
tracecmd/trace-split.c - Trace dump
tracecmd/trace-dump.c
User interfaces
- Python interface
python/tracecmd.py - Event viewer
python/event-viewer.py - Python GUI
python/tracecmdgui.py - trace-cmd CLI
tracecmd/trace-cmd.c
Other components
- Operator
Connections 24
- Operator → Record tracing: starts recording
- Record tracing → Trace writer: writes trace data
tracecmd/trace-record.c - Record tracing → Message transport: uses live transport
- Trace agent → Message transport: exchanges messages
- Live listener → Message transport: handles messages
- Record tracing → Clock synchronization: synchronizes clocks
- Clock synchronization → PTP synchronization: supports PTP
- Trace writer → trace.dat: writes file
- trace.dat → Trace reader: reads file
lib/trace-cmd/trace-input.c - Trace reader → Compression: decodes compression
lib/trace-cmd/trace-input.c - Compression → Zlib backend: selects backend
- Compression → Zstd backend: selects backend
- Library API → Trace reader: exposes reader
include/trace-cmd/trace-cmd.h - Operator → trace-cmd CLI: runs commands
- Trace reading → Trace reader: reads trace events
tracecmd/trace-read.c - Trace profiling → Trace reader: analyzes trace
tracecmd/trace-profile.c - Event histograms → Trace reader: analyzes trace
- SQL histograms → Trace reader: analyzes trace
- Trace statistics → Trace reader: inspects trace
- Trace splitting → Trace reader: processes trace
- Trace dump → Trace reader: processes trace
tracecmd/trace-dump.c - Python interface → Trace reader: reads events
python/tracecmd.py - Event viewer → Python interface: uses interface
python/event-viewer.py - Python GUI → Python interface: uses interface
python/tracecmdgui.py