Re: [PATCH] @+, @- readonly
[p5sagit/p5-mst-13.2.git] / utils / dprofpp.PL
index 451b8bf..51e8d78 100644 (file)
@@ -14,15 +14,14 @@ use File::Basename qw(&basename &dirname);
 # This is so that make depend always knows where to find PL derivatives.
 chdir(dirname($0));
 ($file = basename($0)) =~ s/\.PL$//;
-$file =~ s/\.pl$//
-       if ($Config{'osname'} eq 'VMS' or
-           $Config{'osname'} eq 'OS2');  # "case-forgiving"
+$file =~ s/\.pl$// if ($Config{'osname'} eq 'OS2');      # "case-forgiving"
+$file =~ s/\.pl$/.com/ if ($Config{'osname'} eq 'VMS');  # "case-forgiving"
 
 my $dprof_pm = '../ext/Devel/DProf/DProf.pm';
 my $VERSION = 0;
 open( PM, "<$dprof_pm" ) || die "Can't open $dprof_pm: $!";
 while(<PM>){
-       if( /^\$Devel::DProf::VERSION\s*=\s*'(\d+)'/ ){
+       if( /^\$Devel::DProf::VERSION\s*=\s*'([\d._]+)'/ ){
                $VERSION = $1;
                last;
        }
@@ -45,7 +44,7 @@ $Config{'startperl'}
 
 require 5.003;
 
-my \$VERSION = $VERSION;
+my \$VERSION = '$VERSION';
 
 !GROK!THIS!
 
@@ -82,7 +81,8 @@ be used.
 
        $ perl5 -d:DProf test.pl
 
-Then run dprofpp to analyze the profile.
+Then run dprofpp to analyze the profile.  The output of dprofpp depends
+on the flags to the program and the version of Perl you're using.
 
        $ dprofpp -u
        Total Elapsed Time =    1.67 Seconds
@@ -101,6 +101,44 @@ data.  The above two commands can be executed with one dprofpp command.
 
 Consult L<Devel::DProf/"PROFILE FORMAT"> for a description of the raw profile.
 
+=head1 OUTPUT
+
+Columns are:
+
+=over 4
+
+=item %Time
+
+Percentage of time spent in this routine.
+
+=item #Calls
+
+Number of calls to this routine.
+
+=item sec/call
+
+Average number of seconds per call to this routine.
+
+=item Name
+
+Name of routine.
+
+=item CumulS
+
+Time (in seconds) spent in this routine and routines called from it.
+
+=item ExclSec
+
+Time (in seconds) spent in this routine (not including those called
+from it).
+
+=item Csec/c
+
+Average time (in seconds) spent in each call of this routine
+(including those called from it).
+
+=back
+
 =head1 OPTIONS
 
 =over 5
@@ -398,6 +436,8 @@ Main: {
 #
 sub settime {
   my( $runtime, $hz ) = @_;
+
+  $hz ||= 1;
   
   if( $opt_r ){
     $$runtime = ($rrun_rtime - $overhead - $over_rtime * $total_marks/$over_tests/2)/$hz;