Author: tim.bunce
Date: Thu Jul 2 15:55:13 2009
New Revision: 795
Modified:
trunk/Changes
trunk/NYTProf.xs
trunk/bin/nytprofhtml
trunk/demo/demo-code.pl
trunk/t/test80-recurs.p
trunk/t/test80-recurs.rdt
Log:
Fixed recursion depth measurement.
Changed colors on report pages to be less saturated.
Modified: trunk/Changes
==============================================================================
--- trunk/Changes (original)
+++ trunk/Changes Thu Jul 2 15:55:13 2009
@@ -8,6 +8,9 @@
Fixed risk of infinite recursion if trace enabled and
$SIG{__WARN__} was set to a code reference.
+ Fixed recursion depth measurement.
+
+ Changed colors on report pages to be less saturated.
Added interactive treemap view of package and subroutine times.
Left-click to zoom in (drill-down) one level, right-click to zoom out.
Modified: trunk/NYTProf.xs
==============================================================================
--- trunk/NYTProf.xs (original)
+++ trunk/NYTProf.xs Thu Jul 2 15:55:13 2009
@@ -2119,7 +2119,7 @@
SV *max_depth_sv = *av_fetch(av, NYTP_SCi_REC_DEPTH, 1);
sv_setnv(reci_time_sv, (SvOK(reci_time_sv)) ?
SvNV(reci_time_sv)+incl_subr_sec : incl_subr_sec);
/* we track recursion depth here, which is call_depth-1 */
- if (!SvOK(max_depth_sv) || sub_call_start->call_depth >
SvIV(max_depth_sv)-1)
+ if (!SvOK(max_depth_sv) || sub_call_start->call_depth-1 >
SvIV(max_depth_sv))
sv_setiv(max_depth_sv, sub_call_start->call_depth-1);
}
sv_setnv(excl_time_sv, SvNV(excl_time_sv)+excl_subr_sec);
@@ -2684,6 +2684,7 @@
PL_ppaddr[OP_RAND] = pp_sysop_profiler;
PL_ppaddr[OP_SRAND] = pp_sysop_profiler;
PL_ppaddr[OP_WAIT] = pp_sysop_profiler;
+ PL_ppaddr[OP_SELECT] = pp_sysop_profiler;
}
/* redirect opcodes for caller tracking */
Modified: trunk/bin/nytprofhtml
==============================================================================
--- trunk/bin/nytprofhtml (original)
+++ trunk/bin/nytprofhtml Thu Jul 2 15:55:13 2009
@@ -1716,10 +1716,10 @@
* c3 : path covered or coverage = 100%
*/
.c0, .c1, .c2, .c3 { text-align: right; }
-.c0 { background-color: #ff9999; }
-.c1 { background-color: #ffcc99; }
-.c2 { background-color: #ffff99; }
-.c3 { background-color: #99ff99; }
+.c0 { background-color: #ffb3b3; } /* red */
+.c1 { background-color: #ffd9b4; } /* orange */
+.c2 { background-color: #ffffB4; } /* yellow */
+.c3 { background-color: #B4ffB4; } /* green */
/* warnings */
.warn {
Modified: trunk/demo/demo-code.pl
==============================================================================
--- trunk/demo/demo-code.pl (original)
+++ trunk/demo/demo-code.pl Thu Jul 2 15:55:13 2009
@@ -46,7 +46,7 @@
return $n if $n < 2;
fib($n-1) + fib($n-2);
}
-fib(42);
+fib(7);
# --- File::Find ---
Modified: trunk/t/test80-recurs.p
==============================================================================
--- trunk/t/test80-recurs.p (original)
+++ trunk/t/test80-recurs.p Thu Jul 2 15:55:13 2009
@@ -1,8 +1,8 @@
sub recurs {
my $depth = shift;
- sleep 1;
+ select(undef, undef, undef, 0.3);
recurs($depth-1) if $depth > 1;
}
-recurs(2); # recurs gets called twice
+recurs(3); # recurs gets called twice
Modified: trunk/t/test80-recurs.rdt
==============================================================================
--- trunk/t/test80-recurs.rdt (original)
+++ trunk/t/test80-recurs.rdt Thu Jul 2 15:55:13 2009
@@ -12,25 +12,21 @@
attribute total_stmts_measured 0
attribute total_sub_calls 0
attribute xs_version 0
-fid_block_time 1 2 [ 0 6 ]
+fid_block_time 1 2 [ 0 9 ]
fid_block_time 1 7 [ 0 1 ]
fid_fileinfo 1 [ test80-recurs.p 1 2 0 0 ]
-fid_fileinfo 1 sub main::CORE:sleep 0-0
fid_fileinfo 1 sub main::recurs 1-5
-fid_fileinfo 1 call 3 main::CORE:sleep [ 2 0 0 0 0 0 0
]
-fid_fileinfo 1 call 4 main::recurs [ 1 0 0 0 0 0 1 ]
+fid_fileinfo 1 call 4 main::recurs [ 2 0 0 0 0 0 2 ]
fid_fileinfo 1 call 7 main::recurs [ 1 0 0 0 0 0 0 ]
-fid_line_time 1 2 [ 0 2 ]
-fid_line_time 1 3 [ 0 2 ]
-fid_line_time 1 4 [ 0 2 ]
+fid_line_time 1 2 [ 0 3 ]
+fid_line_time 1 3 [ 0 3 ]
+fid_line_time 1 4 [ 0 3 ]
fid_line_time 1 7 [ 0 1 ]
-fid_sub_time 1 2 [ 0 6 ]
+fid_sub_time 1 2 [ 0 9 ]
fid_sub_time 1 7 [ 0 1 ]
profile_modes fid_block_time block
profile_modes fid_line_time line
profile_modes fid_sub_time sub
-sub_subinfo main::CORE:sleep [ 1 0 0 2 0 0 0 0 ]
-sub_subinfo main::CORE:sleep called_by 1 3 [ 2 0 0
0 0 0 0 ]
-sub_subinfo main::recurs [ 1 1 5 2 0 0 1 0 ]
-sub_subinfo main::recurs called_by 1 4 [ 1 0 0 0 0 0 1
]
+sub_subinfo main::recurs [ 1 1 5 3 0 0 2 0 ]
+sub_subinfo main::recurs called_by 1 4 [ 2 0 0 0 0 0 2
]
sub_subinfo main::recurs called_by 1 7 [ 1 0 0 0 0 0 0
]
--~--~---------~--~----~------------~-------~--~----~
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]
-~----------~----~----~----~------~----~------~--~---