You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Andy Armstrong <an...@hexten.net> on 2008/01/11 21:45:44 UTC

DTrace in Perl: What probes should we have?

As of patch 32953 dtrace support is in bleadperl (5.11.0). The probes  
are based on Alan Burlinson's original blog post on the subject:

     http://blogs.sun.com/alanbur/date/20050909

By guarding the probes with PERL_SUB_*_ENABLED the performance hit is  
unmeasurable.

All the necessary bits already existed in the wild. I just assembled  
them and made the necessary changes to Perl's Configure script. The  
patched Perl works with the examples in DTraceToolkit.

Currently we have probes on subroutine entry and return.

Next I'd like to solicit input about what other probes would be  
useful. I have Sven Dowideit's patch that adds probes on new__sv,  
del__sv (creation and deletion of values) and, main__enter, main__exit  
(interpreter lifecycle) and load__module (require, use etc).

Where else might we usefully probe? What would people find useful?

-- notes --

I'm crossposting this to what I hope are a few interested lists. If  
anyone reading this needs a primer on dtrace this video is highly  
recommended:

   http://video.google.com/videoplay?docid=-8002801113289007228

It's 90 minutes of your life but it'll be time well spent :)

If anyone would like to try bleadperl it is available here:

rsync -avz --exclude .svn/ --delete \
    rsync://ftp.linux.activestate.com/perl-current/ bleadperl

You can configure it like this:

./Configure -de -Dusedevel -Dinc_version_list=none \
     -Dprefix=$install -Dldflags=-Dman3ext=3pm \
     -Duseithreads -Duseshrplib -Uversiononly \
     -Dusedtrace

where $install is your preferred install base.

Right now ./Configure displays a harmless error about '!' being an  
unknown command just after the questions. There's a patch in the  
pipeline to fix that.

-- 
Andy Armstrong, Hexten





Re: [dtrace-discuss] DTrace in Perl: What probes should we have?

Posted by Andy Armstrong <an...@hexten.net>.
On 12 Jan 2008, at 01:32, Bryan Cantrill wrote:
> So, Perl folks:  if you can do it, a ustack helper is the way to  
> go.  It's
> brutal, but the payoff is substantial, as it will be much easier to  
> connect
> misbehaving Perl to the symptoms of that misbehavior elsewhere in the
> system.  If you're interested in seeing a demo of this, check out John
> Levon's blog on the Python ustack helper that he implemented:
>
>  http://blogs.sun.com/levon/entry/python_and_dtrace_in_build


I read that Bryan. I got the impression - maybe incorrectly - that it  
relies on the Python interpreter recursing when it enters a Python  
function - so that a walk up the C stack visits all entries in the  
Python stack. Did I get that wrong?

Perl doesn't recurse in C when it calls a Perl subroutine so walking  
up the stack won't yield a Perl call chain.

-- 
Andy Armstrong, Hexten