Revision: 1114
Author: [email protected]
Date: Mon Mar 8 01:47:29 2010
Log: Add a wrapper for NYTP_write_sub_callers and use it from nytprofmerge.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1114
Modified:
/trunk/FileHandle.xs
/trunk/bin/nytprofmerge
=======================================
--- /trunk/FileHandle.xs Mon Mar 8 01:47:23 2010
+++ /trunk/FileHandle.xs Mon Mar 8 01:47:29 2010
@@ -1116,3 +1116,32 @@
first_line, last_line);
OUTPUT:
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_file handle
+unsigned int fid
+unsigned int line
+SV *caller
+unsigned int count
+NV incl_rtime
+NV excl_rtime
+NV incl_utime
+NV incl_stime
+NV reci_rtime
+unsigned int depth
+SV *called_sub
+ PREINIT:
+ STRLEN caller_len;
+ const char *const caller_p = SvPV(caller, caller_len);
+ STRLEN called_len;
+ const char *const called_p = SvPV(called_sub, called_len);
+ CODE:
+ 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,
+ SvUTF8(called_sub) ?
-(I32)called_len : (I32)called_len);
+ OUTPUT:
+ RETVAL
=======================================
--- /trunk/bin/nytprofmerge Mon Mar 8 01:47:05 2010
+++ /trunk/bin/nytprofmerge Mon Mar 8 01:47:29 2010
@@ -306,13 +306,9 @@
foreach my $called (sort keys %{$callers{$fid_line}}) {
foreach my $caller (sort keys %{$callers{$fid_line}{$called}}) {
my $sum = $callers{$fid_line}{$called}{$caller};
- $out->write('c');
- $out->output_int($fid, $line);
- $out->output_str($caller);
- $out->output_int($sum->{count});
- $out->output_nv(@{$sum}{qw(incl excl ucpu scpu reci)});
- $out->output_int($sum->{depth});
- $out->output_str($called);
+ $out->write_sub_callers($fid, $line, $caller, $sum->{count},
+ @{$sum}{qw(incl excl ucpu scpu reci)},
+ $sum->{depth}, $called);
}
}
}
--
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]