From e9f7de1a29176edd54ce10a0d0aaf74db37282aa Mon Sep 17 00:00:00 2001 From: Harrison Date: Sun, 20 Jul 2025 02:59:38 +0800 Subject: [PATCH] trace-cmd-{list, record, report}: add page, tracecmd: refresh page (#17264) Co-authored-by: Managor <42655600+Managor@users.noreply.github.com> --- pages/linux/trace-cmd-list.md | 21 +++++++++++++++++++++ pages/linux/trace-cmd-record.md | 29 +++++++++++++++++++++++++++++ pages/linux/trace-cmd-report.md | 13 +++++++++++++ pages/linux/trace-cmd.md | 22 +++++++++++++--------- 4 files changed, 76 insertions(+), 9 deletions(-) create mode 100644 pages/linux/trace-cmd-list.md create mode 100644 pages/linux/trace-cmd-record.md create mode 100644 pages/linux/trace-cmd-report.md diff --git a/pages/linux/trace-cmd-list.md b/pages/linux/trace-cmd-list.md new file mode 100644 index 0000000000..2461476792 --- /dev/null +++ b/pages/linux/trace-cmd-list.md @@ -0,0 +1,21 @@ +# trace-cmd list + +> Show available tracers, events, or options for tracing. +> See also: `trace-cmd record`, `trace-cmd report`. +> More information: . + +- List available tracers: + +`sudo trace-cmd list -t` + +- List available plugins: + +`sudo trace-cmd list -p` + +- List available events: + +`sudo trace-cmd list -e` + +- List available functions: + +`sudo trace-cmd list -f` diff --git a/pages/linux/trace-cmd-record.md b/pages/linux/trace-cmd-record.md new file mode 100644 index 0000000000..7479f14c0e --- /dev/null +++ b/pages/linux/trace-cmd-record.md @@ -0,0 +1,29 @@ +# trace-cmd record + +> Capture kernel trace events. +> See also: `trace-cmd list`, `trace-cmd report`. +> More information: . + +- Record a trace with a specific plugin: + +`sudo trace-cmd record -p {{plugin}}` + +- Record a trace of a specific executable: + +`sudo trace-cmd record -F {{executable}}` + +- Record a trace of a specific function: + +`sudo trace-cmd record -g {{function}}` + +- Exclude a specific function from the trace: + +`sudo trace-cmd record -n {{function}}` + +- Limit the function call graph depth: + +`sudo trace-cmd record --max-graph-depth {{depth}}` + +- Record a trace from a specific process ID: + +`sudo trace-cmd record -P {{pid}}` diff --git a/pages/linux/trace-cmd-report.md b/pages/linux/trace-cmd-report.md new file mode 100644 index 0000000000..c2612cc7c1 --- /dev/null +++ b/pages/linux/trace-cmd-report.md @@ -0,0 +1,13 @@ +# trace-cmd report + +> Display recorded trace events. +> See also: `trace-cmd list`, `trace-cmd record`. +> More information: . + +- Display the recorded trace: + +`sudo trace-cmd report` + +- Display the recorded trace for a specific CPU: + +`sudo trace-cmd report --cpu {{cpu_number}}` diff --git a/pages/linux/trace-cmd.md b/pages/linux/trace-cmd.md index f95d86a012..c42e7fe6ae 100644 --- a/pages/linux/trace-cmd.md +++ b/pages/linux/trace-cmd.md @@ -1,33 +1,37 @@ # trace-cmd > Utility to interact with the Ftrace Linux kernel internal tracer. -> This utility only runs as root. +> See also: `trace-cmd list`, `trace-cmd record`, `trace-cmd report`. > More information: . - Display the status of tracing system: -`trace-cmd stat` +`sudo trace-cmd stat` - List available tracers: -`trace-cmd list -t` +`sudo trace-cmd list -t` - Start tracing with a specific plugin: -`trace-cmd start -p {{timerlat|osnoise|hwlat|blk|mmiotrace|function_graph|wakeup_dl|wakeup_rt|wakeup|function|nop}}` +`sudo trace-cmd start -p {{function|function_graph|preemptirqsoff|irqsoff|preemptoff|wakeup|...}}` - View the trace output: -`trace-cmd show` +`sudo trace-cmd show` - Stop the tracing but retain the buffers: -`trace-cmd stop` +`sudo trace-cmd stop` - Clear the trace buffers: -`trace-cmd clear` +`sudo trace-cmd clear` -- Clear the trace buffers and stop tracing: +- Record a trace: -`trace-cmd reset` +`sudo trace-cmd record` + +- Display the recorded trace: + +`sudo trace-cmd report`