Check tracepoint status with trace-cmd
In the previous step, we listed the available tracepoints by exploring the /sys/kernel/debug/tracing/events
directory. Now, let's use the trace-cmd
utility to get more detailed information about tracepoints, specifically their status (whether they are enabled or disabled).
The trace-cmd
command is a powerful tool for interacting with the Linux tracing framework. If trace-cmd
is not already installed, you can install it using apt
.
First, update the package list:
sudo apt update
Then, install trace-cmd
:
sudo apt install trace-cmd
You might see output indicating that trace-cmd
is already installed, which is fine.
Now, to list all available tracepoints and their status, use the trace-cmd list -e
command. The -e
option tells trace-cmd
to list events (tracepoints).
Type the following command and press Enter:
trace-cmd list -e
This command will output a long list of tracepoints, showing their subsystem and name, followed by their current status in square brackets ([enabled]
or [disabled]
).
You will see output similar to this (again, the exact list will vary):
block:block_bio_backmerge [disabled]
block:block_bio_bounce [disabled]
block:block_bio_complete [disabled]
block:block_bio_frontmerge [disabled]
block:block_bio_queue [disabled]
block:block_bio_remap [disabled]
block:block_dirty_buffer [disabled]
block:block_getrq [disabled]
block:block_plug [disabled]
block:block_rq_complete [disabled]
block:block_rq_insert [disabled]
block:block_rq_issue [disabled]
block:block_rq_remap [disabled]
block:block_rq_requeue [disabled]
block:block_sync_buffer [disabled]
block:block_touch_buffer [disabled]
block:block_unplug [disabled]
bpf:bpf_trace_printk [disabled]
bpf:bpf_trace_vprintk [disabled]
... (many more tracepoints)
As you can see, most tracepoints are disabled by default to avoid performance overhead. You would typically enable specific tracepoints when you need to trace particular kernel events.
Using trace-cmd list -e
is a convenient way to see the full list of tracepoints and their current state without manually navigating the /sys/kernel/debug/tracing
filesystem.
Click Continue to move to the next step.