Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Dtrace for Perl

by GoCool (Scribe)
on Sep 08, 2005 at 17:01 UTC ( [id://490268]=perlquestion: print w/replies, xml ) Need Help??

GoCool has asked for the wisdom of the Perl Monks concerning the following question:

While reading this article on slashdot this morning about porting Solaris Dtrace to Freebsd, I realized that there has been a lot of porting of Dtrace being done of late. For example, Dtrace for Ruby, potential of Dtrace for speeding PHP scripts etc.

I haven't used Dtrace myself but from the article I gather that Dtrace does a superior job at exposing the guts of the trace with absolutely no secrets about the internals.

While I'm certainly aware the there are quite a few modules on CPAN for debugging and viewing stack traces of Perl code, is there some work being done or proposals for porting Dtrace to Perl, or is that even required to begin with?

Thanks in advance.

--GoCooL

Replies are listed 'Best First'.
Re: Dtrace for Perl
by Corion (Patriarch) on Sep 08, 2005 at 17:14 UTC

    Another time, it shows that it's really nice to go to the Perl conferences, just for the stuff you pick up in passing

    I think I spent some time with Nicholas Clark and ?nobull? Alan Burlison who implemented the Solaris/Dtrace connection with Perl. It's still in early beta and has a quite severe runtime hit; I think I remember a slowdown of 5% just for linking the Dtrace stuff in, without any instrumentation.

    But I expect this thing to really move forward, even if it's only for Solaris.

    I'm not too familiar with Dtrace myself, but what I gleaned from the idea/concept of Dtrace, it seems quite like the Win32 debugger API (at least for NT and upwards), where an external process can attach to and detach from a running application and instrument it. The effect of this is, that you get a full trace from the Perl level down to the (Solaris) kernel level of all functions called. Which is quite cool, as you can attach it to any running Perl process.

    Update: Alan Burlison talks about DTrace and Perl in his blog.

Re: Dtrace for Perl
by Steve_p (Priest) on Sep 09, 2005 at 01:07 UTC

    It has been discussed on the perl5-porters mailing list already. There haven't been any implementation details yet, though. This would, of course, be a great tool for Perl programmers, although, limited to a small number of platforms.

Re: Dtrace for Perl
by JSchmitz (Canon) on Sep 08, 2005 at 20:05 UTC
    One of many Dtrace functions output on my Solaris 10 box....
    Sample interval is 5 seconds. Total run is > 100 seconds. 0% Interrupts by CPU... 5% Interrupt times... 10% Dispatcher queue length by CPU... 15% Sdt counts... 20% Pages paged in by process... 25% Files opened successfully count... 30% Disk I/O size distribution by process... 35% Minor faults by process... 40% Vminfo data by process... 45% Mib data by mib statistic... 50% TCP write bytes by process... 55% Sample process @ 1000 Hz... 60% Syscall count by process... 65% Syscall count by syscall... 70% Read bytes by process... 75% Write bytes by process... 80% Sysinfo counts by process... 85% New process counts with arguments... 90% Signal counts... 95% Syscall error counts... 100% Done. File is de_Emperor_200509081500.tar.gz
    DTrace is seriously handy you can call it through a shell script or a perl script...

    cheers -
    Jeffery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://490268]
Approved by jfroebe
Front-paged by jfroebe
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-26 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found