Building a Go Profiler Using Go
summary
Builds a live profiler that uses eBPF programs attached to perf events to sample stacks every 10s, collects per-CPU maps from kernel space, and converts raw stack IDs into pprof output compatible profiles for analysis. Uses libbpf/bpfgo tooling and requires sudo because kernel verifier and JIT run the probes. Covers symbolization using Go’s pc/line table (avoids stripping), cross‑build challenges for BPF objects, and a production system called Parka that continuously profiles Go (and C++/Rust) workloads.
AI-written summary · about
chapters (13)
- 0:00Intro
- 2:00About me
- 3:00What is profiling
- 4:00Types of profiling
- 9:50Continuous profiling
- 14:40Extended Berkeley Packet Filtering
- 16:20Second Demo
- 20:20Code
- 24:50CrossCompile
- 25:43Symbolization
- 26:30Unwinding
- 29:23Project Overview
- 31:25Roadmap
related talks
44mGo Profiling and Observability from Scratch
54mTracing Go Programs with eBPF!
45mBoost application performance with profile guided optimization
46mReal World Debugging with eBPF
24mDebuggers and eBPF: Bringing Debugging to Production
36mObservability and performance analysis with BPF
40mTwo Go programs, three different profiling techniques, all in 40 minutes
36mContinuous Profiling in the Cloud-Native era
