Revision: 1222
Author: [email protected]
Date: Fri May  7 04:51:32 2010
Log: Fixed rec_depth in callbacks to be unsigned int not UV (which broke sub_caller callback on 64bit platforms). I only noticed it because of an uninit warning in
http://www.cpantesters.org/cpan/report/7211002. Added tests.

http://code.google.com/p/perl-devel-nytprof/source/detail?r=1222

Modified:
 /trunk/NYTProf.xs
 /trunk/lib/Devel/NYTProf.pm
 /trunk/t/22-readstream.t

=======================================
--- /trunk/NYTProf.xs   Fri May  7 03:45:42 2010
+++ /trunk/NYTProf.xs   Fri May  7 04:51:32 2010
@@ -3869,7 +3869,7 @@
     NV incl_time;
     NV excl_time;
     NV reci_time;
-    UV rec_depth;
+    unsigned int rec_depth;
     SV *called_subname_sv;
     char text[MAXPATHLEN*2];
     SV *sv;
@@ -3884,7 +3884,7 @@
     incl_time = va_arg(args, NV);
     excl_time = va_arg(args, NV);
     reci_time = va_arg(args, NV);
-    rec_depth = va_arg(args, UV);
+    rec_depth = va_arg(args, unsigned int);
     called_subname_sv = va_arg(args, SV *);
     caller_subname_sv = va_arg(args, SV *);

@@ -4131,6 +4131,10 @@
     if (!state->cb[tag])
         return;

+    if (trace_level >= 9) {
+        logwarn("\tcallback %s[%s] \n", description, arglist);
+    }
+
sv_setuv_mg(state->input_chunk_seqn_sv, state->base_state.input_chunk_seqn);

     va_start(args, tag);
@@ -4400,7 +4404,7 @@
                 NV spare_3         = read_nv(in);
                 NV spare_4         = read_nv(in);
                 NV reci_time       = read_nv(in);
-                UV rec_depth       = read_int(in);
+                unsigned int rec_depth = read_int(in);
                 SV *called_subname_sv = read_str(aTHX_ in, tmp_str1_sv);

                 PERL_UNUSED_VAR(spare_3);
=======================================
--- /trunk/lib/Devel/NYTProf.pm Mon May  3 14:06:40 2010
+++ /trunk/lib/Devel/NYTProf.pm Fri May  7 04:51:32 2010
@@ -50,7 +50,7 @@

 =head1 NAME

-Devel::NYTProf - Powerful feature-rich perl source code profiler
+Devel::NYTProf - Powerful fast feature-rich perl source code profiler

 =head1 SYNOPSIS

@@ -65,7 +65,7 @@

 =head1 DESCRIPTION

-Devel::NYTProf is a powerful feature-rich perl source code profiler.
+Devel::NYTProf is a powerful, fast, feature-rich perl source code profiler.

 =over

=======================================
--- /trunk/t/22-readstream.t    Tue Nov 17 13:03:49 2009
+++ /trunk/t/22-readstream.t    Fri May  7 04:51:32 2010
@@ -5,7 +5,7 @@
 use Config;
 use NYTProfTest;

-plan tests => 18;
+plan tests => 20;

 use Devel::NYTProf::ReadStream qw(for_chunks);

@@ -25,7 +25,12 @@
     push @seqn, "$.";
     my $tag = shift;
     push @{ $prof{$tag} }, [ @_ ];
-    if (1) { chomp @_; print "# $. $tag @_\n"; }
+    if (1) {
+        my @params = @_;
+        not defined $_ and $_ = '(undef)' for @params;
+        chomp @params;
+        print "# $. $tag @params\n";
+    }
 } filename => $out;

 ok scalar @seqn, 'should have read chunks';
@@ -52,3 +57,14 @@
 is $attr{nv_size}, $Config{nvsize}, 'nv_size';
 cmp_ok $attr{xs_version}, '>=', 2.1, 'xs_version';
 cmp_ok $attr{basetime}, '>=', $^T, 'basetime';
+
+is_deeply $prof{SUB_INFO}, [
+    [ 1, 1, 1, 'main::A' ],
+    [ 1, 0, 0, 'main::BEGIN' ],
+    [ 1, 1, 1, 'main::RUNTIME' ]
+];
+
+$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' ]
+];

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