trace of method calls


A

avilella

Hi,

I would like to trace all the method calls for a script. What is the
best module people would recommend for this?

Cheers,

Albert.
 
Ad

Advertisements

S

Spiros Denaxas

Hi,

I would like to trace all the method calls for a script. What is the
best module people would recommend for this?

Cheers,

Albert.

Hi Albert,

I would use the Perl debugger for this.

perl -d script.pl

tracing is available with 'T' and it toggled with 't'.

Run 'perldoc perldebtut' for more info.

Addionally, I believe the Perl profiler has a similar output support.
Have a look at:

http://search.cpan.org/~nwclark/perl-5.8.6/utils/dprofpp.PL
and
http://search.cpan.org/perldoc?Devel::DProf

hope this helps,
Spiros
 
A

avilella

Dynamically, or statically?

BugBear

I think what I want is statically. I can use breakpoints and "T", but
I rather want to run the script completely and then have a debug file
with all the method calls.
 
Ad

Advertisements

S

Spiros Denaxas

oh, ok, dynamic then :)

Anyone?

Hi,

then use the Perl profiler and analyze its output with dprofpp.

from the manpage:

-T Display subroutine call tree to stdout. Subroutine
statistics are
not displayed.

-t Display subroutine call tree to stdout. Subroutine
statistics are
not displayed. When a function is called multiple
consecutive
times at the same calling level then it is displayed once
with a
repeat count.

Hope this helps,

Spiros
 

Top