trace-cmd-report
Display recorded ftrace trace data
TLDR
Display the recorded trace
Display the recorded trace for a specific CPU
SYNOPSIS
trace-cmd report [OPTIONS] [trace.dat]
PARAMETERS
-i, --input <file>
Specifies the input trace file to read. Defaults to trace.dat in the current directory.
-o, --output <file>
Writes the report output to the specified file instead of standard output.
-p, --plugin <plugin>
Loads and uses a specific plugin to process and display the trace events. Plugins offer specialized analysis.
-P, --plugin-options <options>
Passes specific options or arguments to the loaded plugin.
--cpu <cpu>
Filters events to show only those occurring on the specified CPU number.
--comm <comm>
Filters events to show only those originating from processes with the specified command name.
--pid <pid>
Filters events to show only those originating from the specified process ID.
--tid <tid>
Filters events to show only those originating from the specified thread ID.
--event <event>
Filters events to show only a specific event type (e.g., sched_switch, syscalls:sys_enter_open).
--start <time>
Specifies the start time (in seconds) from which to report events. Can be relative or absolute based on trace.
--end <time>
Specifies the end time (in seconds) until which to report events.
--format <format>
Sets the output format (pretty for human-readable, raw for raw event data, json for JSON output).
--no-header
Suppresses the display of the trace header information at the beginning of the report.
--no-timestamp
Suppresses the display of timestamps for each event in the report.
--pager
Forces the output to be piped through a pager (e.g., less), even if not automatically detected.
--no-pager
Disables piping the output through a pager, even if it would normally be used.
--debug
Enables debug output, providing more verbose information for troubleshooting.
-v, --verbose
Increases verbosity of the output, showing more details about the processing.
-V, --version
Displays the version information of the trace-cmd utility.
-h, --help
Shows a help message with available options and usage.
DESCRIPTION
The trace-cmd-report command is used to read and display the trace data collected by trace-cmd-record, typically from a trace.dat file. It allows users to view kernel events, filter them by CPU, process ID, command name, event type, and time ranges. The output can be customized in various formats, including a human-readable 'pretty' format, raw event data, or JSON. It also supports plugins for advanced analysis and visualization of specific event types, making it a powerful tool for kernel tracing and debugging.
This command is essential for anyone analyzing system behavior, performance issues, or debugging kernel modules by providing a structured view of the underlying kernel events.
CAVEATS
trace-cmd-report can consume significant memory and CPU when processing very large trace files, especially without effective filtering. Ensure sufficient disk space for output files if redirecting. The accuracy of time filtering (--start, --end) depends on the precision of timestamps recorded in the trace. Some plugins may have specific dependencies or limitations.
DEFAULT INPUT FILE
By default, trace-cmd-report expects the trace data to be in a file named trace.dat in the current working directory. If your trace file has a different name or is located elsewhere, you must specify it using the -i or --input option, or provide it as the final argument to the command.
TYPICAL WORKFLOW
A common workflow involves first recording trace data using trace-cmd record (e.g., trace-cmd record -e sched_switch ls). Then, trace-cmd-report is used to examine the collected data (e.g., trace-cmd report for a summary, or trace-cmd report --event sched_switch for filtered output). For detailed analysis, users might combine filtering with output to a file (trace-cmd report -o output.txt) or pipe it to other tools.
HISTORY
The trace-cmd utility, including trace-cmd-report, is part of the ftrace ecosystem, a powerful tracing framework built into the Linux kernel. Developed primarily by Steven Rostedt, trace-cmd was created to provide a user-friendly frontend to ftrace's extensive capabilities. trace-cmd-report's functionality has evolved alongside ftrace, gaining more filtering options, output formats (like JSON), and plugin support to meet the increasing demands of kernel developers and system administrators for detailed, flexible trace analysis.
SEE ALSO
trace-cmd(1), trace-cmd-record(1), trace-cmd-extract(1), trace-cmd-list(1), trace-cmd-reset(1), perf(1), ftrace(4)