From PostgreSQL wiki
DTrace is a technology for tracing arbitrary points in program execution. Originally developed for Solaris, it has since become available in one form or another on Mac OS and FreeBSD. PostgreSQL has included basic DTrace support since version 8.2, with newer versions (8.4 in particular) expanding the number of probe points in the database available.
Introduction to PostgreSQl and DTrace:
- Dynamic Tracing - official manual section on DTrace probes available
- PostgreSQL DTrace Users Guide
- PostgreSQL performance through the eyes of DTrace and Looking under the hood with Solaris. The pg_file_stress utility there is being migrated to Tasty Treats for PostgreSQL.
- Profiling PostgreSQL using DTRACE on Solaris 10
- User-Level DTrace Probes in PostgreSQL 8.2
General DTrace information:
Example PostgreSQL DTrace scripts:
- DTrace & Postgresql - io tuning
- Some quick numbers about SDD for PostgreSQL
- PostgreSQL Transactions Per Second Using Dtrace
SystemTap & Linux
It's also possible to use the PostgreSQL DTrace probes on some recent Linux systems through the Systemtap user space markers feature: