LinuxCommandLibrary

trace-cmd-record

Record kernel trace to file

TLDR

Record with specific plugin

$ sudo trace-cmd record -p [plugin]
copy
Record specific executable
$ sudo trace-cmd record -F [executable]
copy
Record specific function
$ sudo trace-cmd record -g [function]
copy
Exclude a function
$ sudo trace-cmd record -n [function]
copy
Limit graph depth
$ sudo trace-cmd record --max-graph-depth [depth]
copy
Record from process ID
$ sudo trace-cmd record -P [pid]
copy

SYNOPSIS

trace-cmd record [OPTIONS]

DESCRIPTION

trace-cmd record captures kernel trace events to a file (trace.dat by default). It configures the Ftrace framework, starts tracing, and saves the results for later analysis with trace-cmd report.
Various options allow filtering by function, process, or executable, and limiting trace depth to reduce data volume.

PARAMETERS

-p PLUGIN

Use specified tracer plugin
-F EXECUTABLE
Trace only the specified executable
-g FUNCTION
Trace specified function
-n FUNCTION
Exclude function from trace
--max-graph-depth DEPTH
Limit function call graph depth
-P PID
Trace specified process ID

CAVEATS

Requires root privileges. Large traces consume significant disk space. High-frequency tracing impacts system performance. Output file can grow quickly.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community