go-pprof-profiling
Installation
SKILL.md
Go pprof Profiling
Sampling profiler. Flat = samples in the function itself; cum = samples in the function plus everything it called. Heap is approximate (1 sample per ~512 KB by default) — small hot allocations vanish.
Profile types
| Profile | Endpoint | Measures |
|---|---|---|
| cpu | /debug/pprof/profile?seconds=30 |
wall-clock samples at 100 Hz |
| heap | /debug/pprof/heap |
live + cumulative allocations |
| goroutine | /debug/pprof/goroutine |
all goroutine stacks (leak hunt) |
| block | /debug/pprof/block |
time blocked on sync primitives |
| mutex | /debug/pprof/mutex |
contention on Lock/Unlock |
| trace | /debug/pprof/trace?seconds=5 |
full execution trace (go tool trace) |
Block/mutex are off by default — enable at startup: