Tracing Goroutines in Realtime with eBPF
Summary
The article introduces xgotop, a Go runtime tracing tool built with eBPF to observe goroutine state changes and memory allocations in near real time. It explains Go runtime internals (the g struct and goroutine states), proposes hooks into runtime functions via bpftrace (casgstatus, newobject, makeslice, makemap), and demonstrates a PoC with a test HTTP server to validate tracing, culminating with plans for a standalone project using ring buffers and multi-language support.