Attach to running process perf
Profile an already-running process for 5 seconds
perf record -p 1234 sleep 5
more perf
all 17 commands →
Live CPU flame call graph
perf top -g --call-graph dwarf
System-wide sampled record
perf record -F 99 -a -g -- sleep 30 && perf report --stdio
Flame graph pipeline
perf script | stackcollapse-perf.pl | flamegraph.pl > flame.svg
Detailed counter stats
perf stat -d -d -d -- ./app
Scheduler latency analysis
perf sched record -- sleep 10 && perf sched latency --sort max