[CMI.PM] Perl Debugger and finding CPU Usage

Brandon Bowersox brandon at ojctech.com
Fri Nov 7 16:28:27 CST 2003


Mitch,

The Perl Profiler is the tool for you and it is distributed with Perl.  See
http://search.cpan.org/~nwclark/perl-5.8.2/ext/Devel/DProf/DProf.pm
http://search.cpan.org/~nwclark/perl-5.8.2/utils/dprofpp.PL

Basically, to create a profile file, run your code like:
perl -d:DProf script.pl (on the command line)
OR
#!/usr/bin/perl -d:DProf (at the top of your script)

Then the dprofpp command will give you a report.  My favorite reports are:
dprofpp tmon.out (the basic report including CPU time)
dprofpp -S tmon.out (merged subroutine tree)

Brandon

--
Brandon Bowersox
brandon at ojctech.com
OJC Technologies, Inc.
www.ojctech.com, 217-278-3933


At 03:33 PM 11/7/2003 -0600, Mitch Kutzko wrote:
>Hi, folks -- I have a question about the Perl debugger, which I've
>essentially never actually used.
>
>How do I go about using it to find out where CPU usage is occurring?  I've
>got a very large, very complex script that's soaking up *way* too much CPU
>(but not leaking memory -- already checked for that) for what it's doing,
>but I can't figure out where/how it's happening.
>
>Any ideas on how to get the debugger to show me where all the CPU is going?
>
>Mitch
>--
>Mitch Kutzko | mitch at dast.nlanr.net | mitch at ncsa.uiuc.edu | 217-333-1199
>http://hobbes.ncsa.uiuc.edu/
>_______________________________________________
>Champaign-Urbana mailing list
>Champaign-Urbana at mail.pm.org
>http://mail.pm.org/mailman/listinfo/champaign-urbana




More information about the Champaign-Urbana mailing list