Author: tim.bunce
Date: Thu Nov 13 04:19:05 2008
New Revision: 599
Modified:
trunk/NYTProf.xs
Log:
Add trace for statement discounts.
Discard remaining statement discount - there's almost always 1 due to the
finally 'leaving' the perl source code.
Fix last_line_num (used in trace statements) which wasn't being updated.
Modified: trunk/NYTProf.xs
==============================================================================
--- trunk/NYTProf.xs (original)
+++ trunk/NYTProf.xs Thu Nov 13 04:19:05 2008
@@ -2846,6 +2846,8 @@
break;
}
+ if (trace_level >= 4)
+ warn("discounting next statement after %u:%d\n",
last_file_num, last_line_num);
if (statement_discount)
warn("multiple statement discount after %u:%d\n",
last_file_num, last_line_num);
++statement_discount;
@@ -2947,6 +2949,7 @@
total_stmts_duration += seconds;
statement_discount = 0;
last_file_num = file_num;
+ last_line_num = line_num;
break;
}
@@ -3395,6 +3398,8 @@
sv_free((SV*)live_pids_hv);
sv_free(tmp_str_sv);
+ if (statement_discount) /* discard unused statement_discount */
+ total_stmts_discounted -= statement_discount;
store_attrib_sv(aTHX_ attr_hv, "total_stmts_measured",
newSVnv(total_stmts_measured));
store_attrib_sv(aTHX_ attr_hv, "total_stmts_discounted",
newSVnv(total_stmts_discounted));
store_attrib_sv(aTHX_ attr_hv, "total_stmts_duration",
newSVnv(total_stmts_duration));
--~--~---------~--~----~------------~-------~--~----~
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]
-~----------~----~----~----~------~----~------~--~---