perf Profiling¶
The Linux perf tool provides hardware-level performance counters, CPU profiling, and tracepoint access without requiring application instrumentation. It is the go-to tool for diagnosing CPU hotspots, cache misses, and scheduling latency on production Linux systems.
Contents¶
Start with the primer to understand what perf measures and how, then explore misconceptions and hands-on techniques.
| # | File | What it covers |
|---|---|---|
| 1 | Primer | Hardware counters, perf stat/record/report, flame graphs, and sampling theory |
| 2 | Anti-Primer | Misconceptions about profiling — why wall-clock time alone misleads |
| 3 | Footguns & Pitfalls | Sampling bias, missing symbols, kernel permissions, and overhead concerns |
| 4 | Street Ops | One-liners for CPU profiling, off-CPU analysis, and generating flame graphs |
| 5 | Trivia & Interesting Facts | The evolution of Linux profiling from oprofile to perf to eBPF |