This post contains a few state-of-the-art notes concerning Perl-specific DTrace probes available in OpenSolaris today (2010-05-31). For instructions how to quickly install a working DTrace-enabled version of Perl, skip to the next section.

The OpenSolaris (2010.03, snv_134) Perl binary package comes with DTrace support disabled. Probably a good thing because the current implementation incurs a reported 5% worst-case performance hit - even with no enabled probes!

Perl source packages from 5.12.x on (or maybe already in 5.10.x?) have some basic DTrace support, good for instrumenting calls to and returns from subroutines.

More probes were made available through a patch from Sven Dowideit. However, his patch does not apply cleanly to 5.12.x.

Building DTrace-enabled Perl in OpenSolaris

If you just want the subroutine entry/return probe, apply the mini-patch from Peter Bray's bug report to avoid a build error about missing op.o and perl.o, then skip the next step. On the other hand, if you'd like to try Sven Dowideit's probes as well:

Download and apply this patch (version 2) to your freshly unpacked Perl source. This is a version of Sven's patch updated by myself to apply cleanly to 5.12.x, with an additional fix to Makefile.SH to avoid build interruptions and a fix to avoid a strange segfault in Perl_ck_require when tracing of loaded modules is enabled. Please note that I have not tested Sven's patch extensively. We are probably talking about a development build here that may aid your Perl code debugging efforts rather than something to put in production.