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.
General DTrace information:
Example PostgreSQL DTrace scripts:
SystemTap & Linux
It's also possible to use the PostgreSQL DTrace probes on some recent Linux systems through the Systemtap user space markers feature: