Go Profiling from Bottom Up
summary
Explains how Go produces stack traces and profiles: build embeds go pc line tab and DWARF, unwinding uses either frame pointers (fast, ~2–10% runtime overhead) or slow unwind tables, and symbolization maps PCs to source. Covers profilers: CPU uses SIGPROF at 100 Hz, heap samples ~1/512 KB sampling of allocations, block/mutex sampling tunable (recommend 10000 for block), and a block-profiler bias fix lands in Go 1.17. Mentions pprof format, Datadog continuous profiling work, perf/ebpf tradeoffs and a small ftprof prototype that demonstrates wall-clock profiling limitations.
AI-written summary · about
chapters (21)
- 0:00Start
- 4:06Target audience
- 6:23Go translates between source code and assembly
- 7:06Go translates between assembly and source code
- 7:25Assembly to source code translation information
- 8:05Running a Go Binary
- 11:50Frame Pointer Unwinding
- 12:19Frame Pointers
- 15:21Unwind Tables
- 17:44Unwinding Recap
- 18:42Symbolization
- 19:12Stack Traces Recap
- 19:36Stack traces: Future improvements
- 24:49Tracing: Capture all Events
- 25:04Go Tracer
- 25:39Profiling: Timer based sampling
- 26:30CPU Profiler
- 28:40Goroutine Profiler
- 30:20Tracing + Profiling: Summarizing a Subset of Events
- 31:15Heap Profiler
- 33:51Block Profiler
