Skip to content
21 changes: 21 additions & 0 deletions pages/linux/trace-cmd-list.md
Original file line number Diff line number Diff line change
@@ -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: <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`
29 changes: 29 additions & 0 deletions pages/linux/trace-cmd-record.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# trace-cmd record

> Capture kernel trace events.
> 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}}`
13 changes: 13 additions & 0 deletions pages/linux/trace-cmd-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# trace-cmd report

> Display recorded trace events.
> 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}}`
12 changes: 8 additions & 4 deletions pages/linux/trace-cmd.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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: <https://manned.org/trace-cmd>.

- Display the status of tracing system:
Expand All @@ -14,7 +14,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 {{function|function_graph|preemptirqsoff|irqsoff|preemptoff|wakeup|...}}`

- View the trace output:

Expand All @@ -28,6 +28,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`