Linux command
trace-cmd-record 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo trace-cmd record -p [plugin]
Example
sudo trace-cmd record -F [executable]
Example
sudo trace-cmd record -g [function]
Exclude
sudo trace-cmd record -n [function]
Example
sudo trace-cmd record --max-graph-depth [depth]
Example
sudo trace-cmd record -P [pid]
说明
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.
参数
- -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
FAQ
What is the trace-cmd-record command used for?
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.
How do I run a basic trace-cmd-record example?
Run `sudo trace-cmd record -p [plugin]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p _PLUGIN_ do in trace-cmd-record?
Use specified tracer plugin