views:

229

answers:

1

I am profiling a Perl application with perl -d:DProf. When running dprofpp on the resulting tmon.out file, I get warnings like these:

Compress::Zlib::__ANON__ has 5 unstacked calls in outer
Compress::Zlib::AUTOLOAD has -5 unstacked calls in outer
  • What is an unstacked call?
  • Who or what is "outer"?
  • What do the numbers mean? How can there be a negative number of calls?
  • Should I worry?
+7  A: 

I'll give this a shot:

  • Unstacked calls indicate that when DProf was analyzing the profile, it encountered more (or fewer) calls on the stack (in the profile) than it expected to, meaning that the profiling data is incorrect.
  • "outer" refers to the internal variable %outer in DProf, which (apparently) tracks the stack counts when analyzing a profile.
  • The numbers indicate how many calls DProf expected to find versus how many it found. 5 means that there are more calls than it expected, -5 means there are 5 fewer. Again, this is because the profile data is corrupt.
  • I wouldn't worry about your code integrity, because AFAIK this is due to bugs in the implementation of DProf itself. It seems DProf got confused when writing the tmon.out file. However, the rest of the results from dprofpp may be unreliable due to this inaccuracy. So, you should worry (a little) about the accuracy of those results.

You may want to look into alternate profiling module, like Devel::NYTProf

Adam Bellaire
Excellent answer, thank you Adam.The first thing I did after posting the question was to install NYTProf. I don't think I'll ever look back.Maybe DProf has a little problem with autoloaded subroutines? I'll have to check the other warnings I got.
innaM
I checked the warnings again and the good news is that the number of calls add up to 0. AUTOLOAD contributes much of the negative numbers, but the hugest chunk comes from Exporter::export.
innaM