LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

trace-cmd

Linux kernel Ftrace tracing frontend

TLDR

Display tracing status
$ sudo trace-cmd stat
copy
List available tracers
$ sudo trace-cmd list -t
copy
Start tracing with plugin
$ sudo trace-cmd start -p [function|function_graph|irqsoff|wakeup]
copy
View trace output
$ sudo trace-cmd show
copy
Stop tracing
$ sudo trace-cmd stop
copy
Clear trace buffers
$ sudo trace-cmd clear
copy
Record a trace of specific events
$ sudo trace-cmd record -e [sched_switch]
copy
Record function graph tracing for a specific function
$ sudo trace-cmd record -p function_graph -g [function_name]
copy
Display recorded trace from file
$ trace-cmd report
copy
List available events
$ sudo trace-cmd list -e
copy

SYNOPSIS

trace-cmd COMMAND [OPTIONS]

DESCRIPTION

trace-cmd is a utility for interacting with the Linux kernel's Ftrace tracing framework. It provides a user-friendly interface for configuring and capturing kernel traces, analyzing function calls, timing, and system events.The tool supports various tracer plugins including function tracing, function call graphs, and latency tracers for debugging and performance analysis.

PARAMETERS

-p PLUGIN

Specify tracer plugin (function, function_graph, irqsoff, wakeup, etc.)
-e EVENT
Enable a trace event (can be specified multiple times)
-g FUNCTION
Trace calls starting from a specific function (used with function_graph)
-o FILE
Write trace output to specified file (default: trace.dat)
-t
List available tracers (used with list subcommand)
-F
Trace only the child process after a fork

COMMANDS

stat

Display tracing system status
start
Start the kernel tracer
stop
Stop the kernel tracer
show
View current trace output
clear
Clear trace buffers
record
Record a trace to file
report
Display recorded trace
list
List available tracers, events, and functions

INSTALL

sudo apt install trace-cmd
copy
sudo dnf install trace-cmd
copy
sudo pacman -S trace-cmd
copy
sudo zypper install trace-cmd
copy
nix profile install nixpkgs#trace-cmd
copy

CAVEATS

Requires root privileges. Tracing can impact system performance. Large traces consume significant memory and storage. Some features depend on kernel configuration.

HISTORY

trace-cmd was created by Steven Rostedt as a front-end for the Linux kernel's Ftrace framework, simplifying the process of kernel tracing and analysis.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid