Tracing PostgreSQL Using eBPF and Hardware Breakpoints
Hardware breakpoints can trigger eBPF programs when specific memory addresses are accessed, leveraging CPU hardware support for low overhead. By utilizing these hardware breakpoints, we can efficiently monitor PostgreSQL’s internal variable updates, such as transaction ID generation and OID assignment. In this post, we will discuss what hardware breakpoints are, whether they have less overhead than uprobes, and how to answer questions like “How many transaction IDs are assigned per second?” or “Which backend is consuming the most OIDs?” with bpftrace.
Jan’s blog