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

tool
perf17 commands
tags
perfperformancemonitoringtroubleshooting

More perf commands

  • perf sched record -- sleep 10 && perf sched latency --sort max

    Record context switches then show per-task wakeup latency; find runqueue starvation

  • perf trace -s -p <pid>

    strace-like syscall trace with -s summary; lower overhead, no ptrace stop-the-world

  • perf probe --add 'tcp_sendmsg size' && perf record -e probe:tcp_sendmsg -a -- sleep 5

    Add a kprobe with an argument, then record it; inspect kernel internals without rebuilding

  • perf record -g ./my_app

    Record performance data with call-graph info

  • perf report

    Interactive display of recorded perf data

all 17 perf commands