perf

17 commands

17 shown

Record CPU cycles Record performance data with call-graph info perf record -g ./my_app #perf#profiling#cpu#linux Show perf report Interactive display of recorded perf data perf report #perf#profiling#report List available events List all supported perf events on current system perf list #perf#profiling#events Stat command Show hardware counters for a command perf stat ls -la #perf#profiling#stat Record with specific event Record only cache-miss events perf record -e cache-misses ./my_app #perf#profiling#cache Top-like live view Show live per-function CPU usage (like top) perf top #perf#profiling#top#live Annotate hot functions Show annotated assembly for hottest function perf annotate #perf#profiling#annotate Flamegraph data collection Collect data suitable for flamegraph generation perf record -F 99 -ag -- sleep 30 && perf script > out.perf #perf#profiling#flamegraph Count syscalls Count specific syscall events perf stat -e syscalls:sys_enter_read ./my_app #perf#profiling#syscalls Attach to running process Profile an already-running process for 5 seconds perf record -p 1234 sleep 5 #perf#profiling#attach#pid Live CPU flame call graph Live top hot functions with caller chains; dwarf unwind works without frame pointers perf top -g --call-graph dwarf #perf#performance#debug#troubleshooting System-wide sampled record Sample whole machine at 99Hz for 30s, then print collapsed report; 99Hz dodges lockstep aliasing perf record -F 99 -a -g -- sleep 30 && perf report --stdio #perf#performance#monitoring#troubleshooting Flame graph pipeline Turn perf.data into an interactive flame graph SVG (Brendan Gregg FlameGraph tools) perf script | stackcollapse-perf.pl | flamegraph.pl > flame.svg #perf#performance#observability#troubleshooting Detailed counter stats Run with three -d for L1/LLC/TLB and stalled-cycle detail; reveals memory-bound vs CPU-bound perf stat -d -d -d -- ./app #perf#performance#monitoring#troubleshooting Scheduler latency analysis Record context switches then show per-task wakeup latency; find runqueue starvation perf sched record -- sleep 10 && perf sched latency --sort max #perf#performance#kernel#troubleshooting Syscall trace via perf strace-like syscall trace with -s summary; lower overhead, no ptrace stop-the-world perf trace -s -p <pid> #perf#debug#performance#troubleshooting Dynamic probe on function Add a kprobe with an argument, then record it; inspect kernel internals without rebuilding perf probe --add 'tcp_sendmsg size' && perf record -e probe:tcp_sendmsg -a -- sleep 5 #perf#kernel#debug#observability
no commands match