Skip to content
22 changes: 22 additions & 0 deletions pages/linux/trace-cmd-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# trace-cmd-list

> Show available tracers, events, or options for tracing.
> This utility only runs as root.
> See also: `trace-cmd record`, `trace-cmd report`.
> More information: <https://manned.org/trace-cmd-list>.
- 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`
30 changes: 30 additions & 0 deletions pages/linux/trace-cmd-record.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# trace-cmd-record

> Capture kernel trace events.
> This utility only runs as root.
> See also: `trace-cmd list`, `trace-cmd report`.
> More information: <https://manned.org/trace-cmd-record>.
- 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}}`
14 changes: 14 additions & 0 deletions pages/linux/trace-cmd-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# trace-cmd-report

> Display recorded trace events.
> This utility only runs as root.
> See also: `trace-cmd list`, `trace-cmd record`.
> More information: <https://manned.org/trace-cmd-report>.
- Display the recorded trace:

`sudo trace-cmd report`

- Display the recorded trace for a specific CPU:

`sudo trace-cmd report --cpu {{cpu_number}}`
11 changes: 8 additions & 3 deletions pages/linux/trace-cmd.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

> 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: <https://manned.org/trace-cmd>.

- Display the status of tracing system:
Expand All @@ -14,7 +15,7 @@

- Start tracing with a specific plugin:

`trace-cmd start -p {{timerlat|osnoise|hwlat|blk|mmiotrace|function_graph|wakeup_dl|wakeup_rt|wakeup|function|nop}}`
`trace-cmd start -p {{plugin}}`

- View the trace output:

Expand All @@ -28,6 +29,10 @@

`trace-cmd clear`

- Clear the trace buffers and stop tracing:
- Record a trace:

`trace-cmd reset`
`trace-cmd record`

- Display the recorded trace:

`trace-cmd report`