Go profiling from bottom up
summary
Go tooling produces CPU, heap, mutex, block and goroutine profiles in pprof format and uses setitimer 100Hz with SIGPROF for CPU sampling (risk of bias past ~250Hz and random-thread delivery). Binaries include frame pointers added by default (~2% overhead) and two unwind/symbol tables (go_pc_line_tab used by runtime, DWARF used by external tools). Heap sampling targets ~512KB Poisson per allocation, block/mutex sampling is post-event (block bias fixed in Go 1.17), goroutine dumps stop-the-world (2–10μs per goroutine), and thread_create profiling is currently broken.
AI-written summary · about
chapters (22)
- 0:00Start
- 3:49Target audience
- 6:06Go translates between source code and assembly
- 6:49Go translates between assembly and source code
- 7:08Assembly to source code translation information
- 7:48Running a Go Binary
- 8:54Stack Traces Umiding
- 11:33Frame Pointer Unwinding
- 12:02Frame Pointers
- 15:04Unwind Tables
- 17:27Unwinding Recap
- 18:25Symbolization
- 18:55Stack Traces Recap
- 19:19Stack traces: Future improvements
- 24:32Tracing: Capture all Events
- 24:47Go Tracer
- 25:22Profiling: Timer based sampling
- 26:13CPU Profiler
- 28:23Goroutine Profiler
- 30:03Tracing + Profiling: Summarizing a Subset of Events
- 30:58Heap Profiler
- 33:34Block Profiler
