PGTracer: A Tracing Tool for Postgres Backends
summary
PGTracer is a root-run tool that uses eBPF plus DWARF debug symbols to attach to a running Postgres backend, dump live query text, buffer and IO stats, and reconstruct per-query execution plans by correlating node events with stack samples. It compiles per-instance eBPF, supports tracing a single PID or the whole cluster, can toggle instrumentation and even overwrite global variables in-process, and shows kernel‑vs‑cache IO. Works in demos but needs matching kernel headers, CAP_SYS_ADMIN, and hits eBPF verifier and sampling limits.
AI-written summary · about
chapters (7)
- 0:00Start
- 0:29ABOUT MYSELF
- 1:05QUICK SURVEY!
- 13:30Example
- 19:21DWARF
- 37:38FUN THINGS ABOUT WORKING WITH EBPF
- 40:27QUESTIONS?
related talks
25mKernel tracing with BPF
56mPostgreSQL at low Level: stay curious!
54mTracing Go Programs with eBPF!
27mLow-Overhead Tracing Using eBPF for Observability into Kubernetes Apps and Services
24mDebuggers and eBPF: Bringing Debugging to Production
47mpg_profile: a strategic PostgreSQL monitoring utility
34mTrace-Profiling: A New Way About How to Track Application Behavior
46mReal World Debugging with eBPF
