Dear Lazyweb: Alternatives to dprofpp -T ?

Alias on 2009-10-23T00:26:05

When it still worked reliably, my heaviest usage Devel::DProf wasn't for the profiling. What I used it the most for was tracing.

The dprofpp -T option would generate a space-indented dump of every single function call made in the program, including all the BEGIN stuff as the program compiled.

It was particularly useful for crashing or failing programs, because you could just start at the end of the trace and then watch the explosion backwards in slow motion, moving back to find the place where it all started to go wrong.

Unfortunately the new king of profilers, Devel::NYTProf, can't replicate this neat trick (yet?).

In the mean time, does anyone have a recommendation of where I can go to get the same information? I can't find anything obvious...


Devel::Trace?

mattk on 2009-10-23T04:54:35

I like to use a tweaked copy of mjd's Devel::Trace for this purpose ($TRACE is set to 0 by default). It's fairly verbose as it prints each line before executing it (similar to bash's -x flag) so it doesn't really help unless you have a somewhat good idea where a problem is occurring, but if you're in one of those situations where brute force is required it's definitely useful.

Perl debugger also has tracing

daxim on 2009-10-23T09:48:10

> perl -d foo.pl
[...]

  DB<1> t
Trace = on

  DB<1> c

Re:Perl debugger also has tracing

jjore on 2009-10-23T19:23:52

Ah, neat. You can make this happen w/o user interaction with a ~/.perldb too.

# ~/.perldb
push @DB::typeahead = (
  't',
  'c',
);