DTrace
Sun's Solaris 10 release in 2004 introduced DTrace, perhaps the most comprehensive toolkit for profiling available on any operating system. The probes required to instrument code with DTrace have minimal overhead when they are not enabled, and the way they're inserted makes it possible to instrument a production system very safely. Making this level of power available to regular user level processes is also quite useful.
PostgreSQL must have been compiled with the --enable-dtrace
option for its DTrace probes to be available. You could write an entire book just on how to use DTrace with PostgreSQL. The main PostgreSQL manual section at http://www.postgresql.org/docs/current/interactive/dynamic-trace.html covers all the probe points available as of the current version. Links to additional utilities and documentation are available at http://wiki.postgresql.org/wiki/DTrace.
The DTrace implementation on Apple's Mac OS X is also very complete, including surprisingly...