Revision: 1260
Author: [email protected]
Date: Tue Jun  1 06:17:33 2010
Log: Remove two "spare" NVs from the sub_callers entries in the profile file.

Also remove them from the Perl callback interface. This is an incompatible
change to both this interface and the profile files in Devel::NYTProf 3.x.

Previously these were used to record user and system CPU time.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1260

Modified:
 /trunk/FileHandle.h
 /trunk/FileHandle.xs
 /trunk/NYTProf.xs
 /trunk/bin/nytprofmerge
 /trunk/lib/Devel/NYTProf/ReadStream.pm
 /trunk/t/22-readstream.t

=======================================
--- /trunk/FileHandle.h Mon Mar  8 01:49:47 2010
+++ /trunk/FileHandle.h Tue Jun  1 06:17:33 2010
@@ -112,8 +112,7 @@
                               unsigned int line,
                               const char *caller_name, I32 caller_name_len,
unsigned int count, NV incl_rtime, NV excl_rtime,
-                              NV incl_utime, NV incl_stime, NV reci_rtime,
-                              unsigned int depth,
+                              NV reci_rtime, unsigned int depth,
const char *called_name, I32 called_name_len);
 size_t NYTP_write_src_line(NYTP_file ofile, unsigned int fid,
unsigned int line, const char *text, I32 text_len);
=======================================
--- /trunk/FileHandle.xs        Wed Apr 28 10:02:41 2010
+++ /trunk/FileHandle.xs        Tue Jun  1 06:17:33 2010
@@ -1017,8 +1017,7 @@
NYTP_write_sub_callers(NYTP_file ofile, unsigned int fid, unsigned int line,
                        const char *caller_name, I32 caller_name_len,
                        unsigned int count, NV incl_rtime, NV excl_rtime,
-                       NV incl_utime, NV incl_stime, NV reci_rtime,
-                       unsigned int depth,
+                       NV reci_rtime, unsigned int depth,
                        const char *called_name, I32 called_name_len)
 {
     size_t total;
@@ -1048,14 +1047,6 @@
     if (retval < 1)
         return retval;

-    total += retval = output_nv(ofile, incl_utime);
-    if (retval < 1)
-        return retval;
-
-    total += retval = output_nv(ofile, incl_stime);
-    if (retval < 1)
-        return retval;
-
     total += retval = output_nv(ofile, reci_rtime);
     if (retval < 1)
         return retval;
@@ -1256,7 +1247,7 @@
         RETVAL

 size_t
-NYTP_write_sub_callers(handle, fid, line, caller, count, incl_rtime, excl_rtime, incl_utime, incl_stime, reci_rtime, depth, called_sub) +NYTP_write_sub_callers(handle, fid, line, caller, count, incl_rtime, excl_rtime, reci_rtime, depth, called_sub)
 NYTP_file handle
 unsigned int fid
 unsigned int line
@@ -1264,8 +1255,6 @@
 unsigned int count
 NV incl_rtime
 NV excl_rtime
-NV incl_utime
-NV incl_stime
 NV reci_rtime
 unsigned int depth
 SV *called_sub
@@ -1278,8 +1267,7 @@
         RETVAL = NYTP_write_sub_callers(handle, fid, line, caller_p,
SvUTF8(caller) ? -(I32)caller_len : (I32)caller_len,
                                         count, incl_rtime, excl_rtime,
-                                        incl_utime, incl_stime, reci_rtime,
-                                        depth, called_p,
+                                        reci_rtime, depth, called_p,
SvUTF8(called_sub) ? -(I32)called_len : (I32)called_len);
     OUTPUT:
         RETVAL
=======================================
--- /trunk/NYTProf.xs   Tue Jun  1 03:44:01 2010
+++ /trunk/NYTProf.xs   Tue Jun  1 06:17:33 2010
@@ -3312,8 +3312,6 @@
                                    (unsigned int)count,
                                    sc[NYTP_SCi_INCL_RTIME],
                                    sc[NYTP_SCi_EXCL_RTIME],
-                                   0.0, /* NYTP_SCi_spare_3 */
-                                   0.0, /* NYTP_SCi_spare_4 */
                                    sc[NYTP_SCi_RECI_RTIME],
                                    (unsigned int)depth,
                                    called_subname, called_subname_len);
@@ -4193,7 +4191,7 @@
     {STR_WITH_LEN("NEW_FID"), "uuuuuuS"},
     {STR_WITH_LEN("SRC_LINE"), "uuS"},
     {STR_WITH_LEN("SUB_INFO"), "uuus"},
-    {STR_WITH_LEN("SUB_CALLERS"), "uuunn..nuss"},
+    {STR_WITH_LEN("SUB_CALLERS"), "uuunnnuss"},
     {STR_WITH_LEN("PID_START"), "uun"},
     {STR_WITH_LEN("PID_END"), "un"},
     {STR_WITH_LEN("[string]"), NULL},
@@ -4254,12 +4252,6 @@
             XPUSHs(cb_args[i++]);
             break;
         }
-        case '.':
-        {
-            sv_setnv(cb_args[i], 0.0);
-            XPUSHs(cb_args[i++]);
-            break;
-        }
         case 'n':
         {
             NV n = va_arg(args, NV);
@@ -4494,15 +4486,10 @@
                 unsigned int count = read_int(in);
                 NV incl_time       = read_nv(in);
                 NV excl_time       = read_nv(in);
-                NV spare_3         = read_nv(in);
-                NV spare_4         = read_nv(in);
                 NV reci_time       = read_nv(in);
                 unsigned int rec_depth = read_int(in);
                 SV *called_subname_sv = read_str(aTHX_ in, tmp_str1_sv);

-                PERL_UNUSED_VAR(spare_3);
-                PERL_UNUSED_VAR(spare_4);
-
                 callbacks[nytp_sub_callers](state, nytp_sub_callers, fid,
line, count, incl_time, excl_time,
                                             reci_time, rec_depth,
=======================================
--- /trunk/bin/nytprofmerge     Sun May 30 01:30:17 2010
+++ /trunk/bin/nytprofmerge     Tue Jun  1 06:17:33 2010
@@ -167,7 +167,7 @@
         $out->write_sub_info($output_fid, $name, $first_line, $last_line);
      },
      SUB_CALLERS => sub {
- my (undef, $fid, $line, $count, $incl_time, $excl_time, $ucpu_time, $scpu_time, $reci_time, $rec_depth, $called, $caller) = @_; + my (undef, $fid, $line, $count, $incl_time, $excl_time, $reci_time, $rec_depth, $called, $caller) = @_;
         confess("No mapping for $fid") unless defined $fids{$fid};
         $fid = $fids{$fid};
         my $mapped_fid = $map_range{$fid}[$line];
@@ -178,8 +178,6 @@
             $sum->{count} += $count;
             $sum->{incl} += $incl_time;
             $sum->{excl} += $excl_time;
-            $sum->{ucpu} += $ucpu_time;
-            $sum->{scpu} += $scpu_time;
             $sum->{reci} += $reci_time;
             $sum->{depth} = $rec_depth if $rec_depth > $sum->{depth};
         } else {
@@ -190,8 +188,6 @@
                  count => $count,
                  incl => $incl_time,
                  excl => $excl_time,
-                 ucpu => $ucpu_time,
-                 scpu => $scpu_time,
                  reci => $reci_time,
                 };
         }
@@ -303,7 +299,7 @@
        foreach my $caller (sort keys %{$callers{$fid_line}{$called}}) {
            my $sum = $callers{$fid_line}{$called}{$caller};
            $out->write_sub_callers($fid, $line, $caller, $sum->{count},
-                                   @{$sum}{qw(incl excl ucpu scpu reci)},
+                                   @{$sum}{qw(incl excl reci)},
                                    $sum->{depth}, $called);
        }
     }
=======================================
--- /trunk/lib/Devel/NYTProf/ReadStream.pm      Tue Jun  1 04:10:35 2010
+++ /trunk/lib/Devel/NYTProf/ReadStream.pm      Tue Jun  1 06:17:33 2010
@@ -181,7 +181,7 @@
 the perl subroutines defined in all the files visited while profiling.
 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, $caller_name +=item SUB_CALLERS => $fid, $line, $count, $incl_time, $excl_time, $reci_time, $rec_depth, $name, $caller_name

 At the end of the run the profiler will output chunks that report on
 where subroutines were called from.
=======================================
--- /trunk/t/22-readstream.t    Fri May  7 04:51:32 2010
+++ /trunk/t/22-readstream.t    Tue Jun  1 06:17:33 2010
@@ -66,5 +66,5 @@

 $prof{SUB_CALLERS}[0][$_] = 0 for (3,4);
 is_deeply $prof{SUB_CALLERS}, [
-    [ 1, 3, 1, 0, 0, '0', '0', '0', 0, 'main::A', 'main::RUNTIME' ]
+    [ 1, 3, 1, 0, 0, '0', 0, 'main::A', 'main::RUNTIME' ]
 ];

--
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