I've been promising myself some time to try out DTrace on TWiki's codebase for over a year. By following Bryan Allen's
instructions using Richard Dawe's adaption of Alan Burlison's work… I now have a Perl 5.8.8 with DTrace probes.
Sounds great, except for one thing…. I now have to learn enough about DTrace to use it 🙂 The patch that Alan and Richard have (or at least their DTrace scripts) seem to require a priori knowledge of the Perl process' pid… not something thats going to work out for what I want to do.
For a quick test, DTrace -c ./view -s /export/home/sven/src/dtrace/subs-tree.d does show the program flow.
The following is while running some perl scripts – the 2 numbers are their pids.
$1
$1
$1
$1
$1
$1
$1
$1
$1
$1
$1
$1
$1
$1
$1
$1
$1
so… first ignorant modification – in subs-tree.d, it wants to trace perl$target:::sub-entry – change that to perl*:::sub-entry, and of course, it works exactly as I want – attaches to all subsequent perl process (running my dtrace-perl build) and tells me whats going on. The only caveat being that the DTrace script will only start if there is a Perl process running – the provider is obviously not persistent.
Brilliant!
Should be a fun Christmas holiday adventure – 410 pages of dtrace book, and a myriad of web pages to consume and digest.