Various changes to regex diagnostics and testing
[p5sagit/p5-mst-13.2.git] / utils / dprofpp.PL
index e62c07a..ef99488 100644 (file)
@@ -337,13 +337,13 @@ sub shortusage {
     print <<'EOF';
 dprofpp [options] [profile]
 
-    -A          Count autoloaded to *AUTOLOAD
+    -A          Count autoloaded to *AUTOLOAD.
     -a          Sort by alphabetic name of subroutines.
-    -d          Reverse sort
+    -d          Reverse sort.
     -E          Sub times are reported exclusive of child times. (default)
-    -f          Filter all calls mathcing the pattern.
+    -f          Filter all calls matching the pattern.
     -G          Group all calls matching the pattern together.
-    -g subr     Count only those who are SUBR or called from SUBR
+    -g subr     Count only subs who are SUBR or called from SUBR.
     -H          Display long manual page.
     -h          Display this short usage message.
     -I          Sub times are reported inclusive of child times.
@@ -351,12 +351,12 @@ dprofpp [options] [profile]
     -O cnt      Specifies maximum number of subroutines to display.
     -P          Used with -G to pull all other calls together.
     -p script   Specifies name of script to be profiled.
-    -Q          Used with -p to indicate the dprofpp should quit
+    -Q          Used with -p to indicate that dprofpp should quit
                 after profiling the script, without interpreting the data.
     -q          Do not print column headers.
-    -R          Count anonyms separately even if from the same package
+    -R          Count anonymous subs separately even if from the same package.
     -r          Use real elapsed time rather than user+system time.
-    -S          Create statistics for all the depths
+    -S          Create statistics for all the depths.
     -s          Use system time rather than user+system time.
     -T          Show call tree.
     -t          Show call tree, compressed.
@@ -735,7 +735,7 @@ sub parsestack {
 
                my $ot = $t;
                if ( $dir eq '/' ) {
-                 $syst = $stack[-1][0];
+                 $syst = $stack[-1][0] if scalar @stack;
                  $usert = '&';
                  $dir = '-';
                  #warn("Inserted exit for $stack[-1][0].\n")
@@ -763,9 +763,9 @@ sub parsestack {
                        }
                        add_to_tree($curdeep_times, $ename,
                                    $t - $overhead) if $opt_S;
-                       exitstamp( \@stack, \@tstack, 
-                                  $t - $overhead, 
-                                  $times, $ctimes, $ename, \$in, $tab, 
+                       exitstamp( \@stack, \@tstack,
+                                  $t - $overhead,
+                                  $times, $ctimes, $name, \$in, $tab,
                                   $curdeep_times, \%outer );
                } 
                next unless $in_level or $name eq $opt_g;