Author: tim.bunce
Date: Tue Jul 14 23:28:44 2009
New Revision: 826

Modified:
    trunk/Changes
    trunk/bin/nytprofcg
    trunk/bin/nytprofhtml
    trunk/lib/Devel/NYTProf/Data.pm
    trunk/lib/Devel/NYTProf/ReadStream.pm

Log:
Changed from using the hackish and limited subname_at_file_line() method, to
using the sub caller data collected at runtime.
Changed "SUB_LINE_RANGE" tag in ReadStream to "SUB_INFO"


Modified: trunk/Changes
==============================================================================
--- trunk/Changes       (original)
+++ trunk/Changes       Tue Jul 14 23:28:44 2009
@@ -17,6 +17,8 @@
      $SIG{__WARN__} was set to a code reference.
    Fixed subroutine recursion depth measurement.

+  Changed ReadStream SUB_LINE_RANGE tag to SUB_INFO.
+
    Added log=F option to write trace log to a file.

    Added sysops=N option which enables profiling of perl opcodes

Modified: trunk/bin/nytprofcg
==============================================================================
--- trunk/bin/nytprofcg (original)
+++ trunk/bin/nytprofcg Tue Jul 14 23:28:44 2009
@@ -54,9 +54,11 @@
      my @callers;
      while ( my ( $fid, $fid_line_info ) = each %$callers ) {
          for my $line ( keys %$fid_line_info ) {
-            my ( $count, $incl_time, $excl_time ) = @{  
$fid_line_info->{$line} };
+            my ( $count, $incl_time, $excl_time, undef, undef, undef,
+                undef, $calling_subs) = @{ $fid_line_info->{$line} };
+
+            my @subnames = sort keys %$calling_subs;

-            my @subnames = $profile->subname_at_file_line( $fid, $line );
              ref $_ and $_ = sprintf "%s (merge of %d subs)", $_->[0],  
scalar @$_
                  for @subnames;
              my $subname = (@subnames) ? join( " or ", @subnames  
) : "__main";

Modified: trunk/bin/nytprofhtml
==============================================================================
--- trunk/bin/nytprofhtml       (original)
+++ trunk/bin/nytprofhtml       Tue Jul 14 23:28:44 2009
@@ -497,10 +497,11 @@
          # order by most frequent caller first
          @callers = sort { $b->[2] <=> $a->[2] || $b->[3] <=> $a->[3] }  
@callers;
          for my $caller (@callers) {
-            my ($fid, $line, $count, $incl_time, $excl_time) = @$caller;
+            my ($fid, $line, $count, $incl_time, $excl_time, undef, undef,
+                undef, undef, $calling_subs) = @$caller;
              my $fi = $profile->fileinfo_of($fid);

-            my @subnames = $profile->subname_at_file_line($fid, $line);
+            my @subnames = sort keys %$calling_subs;
              ref $_ and $_ = sprintf "%s (merge of %d subs)", $_->[0],  
scalar @$_
                  for @subnames;
              my $subname = (@subnames) ? " by " . join(" or ",  
@subnames) : "";

Modified: trunk/lib/Devel/NYTProf/Data.pm
==============================================================================
--- trunk/lib/Devel/NYTProf/Data.pm     (original)
+++ trunk/lib/Devel/NYTProf/Data.pm     Tue Jul 14 23:28:44 2009
@@ -596,6 +596,8 @@
    @subname = $profile->subname_at_file_line($file, $line_number);
    $subname = $profile->subname_at_file_line($file, $line_number);

+This method is currently unused and may be deprecated.
+
  =cut



Modified: trunk/lib/Devel/NYTProf/ReadStream.pm
==============================================================================
--- trunk/lib/Devel/NYTProf/ReadStream.pm       (original)
+++ trunk/lib/Devel/NYTProf/ReadStream.pm       Tue Jul 14 23:28:44 2009
@@ -177,11 +177,11 @@
  Indicates that the next TIME_BLOCK or TIME_LINE should not increment the
  "number of times the statement was executed". See the 'leave' option.

-=item SUB_LINE_RANGE => $fid, $beg, $end, $name
+=item SUB_INFO => $fid, $first_line, $last_line, $name

  At the end of the run the profiler will output chunks that report on
  the perl subroutines defined in all the files visited while profiling.
-This is a straight dump C<%DB::sub>; see L<perldebguts>.
+See also C<%DB::sub> in L<perldebguts>.

  =item SUB_CALLERS => $fid, $line, $count, $incl_time, $excl_time,  
$ucpu_time, $scpu_time, $reci_time, $rec_depth, $name


--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to