Revision: 955
Author: [email protected]
Date: Thu Dec 17 05:46:32 2009
Log: Move calls to normalize_eval_seqn() after the callback runs, so that
the
callback gets the original filename(s). As its return value is now no longer
used, normalize_eval_seqn() can become static void.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=955
Modified:
/trunk/NYTProf.xs
=======================================
--- /trunk/NYTProf.xs Wed Dec 16 09:56:07 2009
+++ /trunk/NYTProf.xs Thu Dec 17 05:46:32 2009
@@ -3737,7 +3737,7 @@
}
-static SV *
+static void
normalize_eval_seqn(pTHX_ SV *sv) {
/* in-place-edit any eval sequence numbers to 0 */
int found = 0;
@@ -3747,7 +3747,7 @@
char *dst = start;
if (len < 5)
- return sv;
+ return;
/* effectively does $sv =~ s/(?<!$assert) \s \d+/eval 0/xg;
* where $assert is qr/\((?:re_)?eval/ so it only matches '(eval '
and '(re_eval '
@@ -3778,8 +3778,6 @@
if (trace_level >= 5)
logwarn("edited it to: %s\n", start);
}
-
- return sv;
}
@@ -4102,8 +4100,6 @@
unsigned int file_mtime = read_int();
filename_sv = read_str(aTHX_ NULL);
- if (eval_file_num)
- normalize_eval_seqn(aTHX_ filename_sv);
if (cb) {
PUSHMARK(SP);
@@ -4125,6 +4121,9 @@
SPAGAIN;
break;
}
+
+ if (eval_file_num)
+ normalize_eval_seqn(aTHX_ filename_sv);
if (trace_level >= 2) {
logwarn("Fid %2u is %s (eval %u:%u) 0x%x sz%u mt%u\n",
@@ -4231,7 +4230,7 @@
AV *av;
SV *sv;
unsigned int fid = read_int();
- SV *subname_sv = normalize_eval_seqn(aTHX_ read_str(aTHX_
tmp_str1_sv));
+ SV *subname_sv = read_str(aTHX_ tmp_str1_sv);
unsigned int first_line = read_int();
unsigned int last_line = read_int();
int skip_subinfo_store = 0;
@@ -4257,6 +4256,8 @@
SPAGAIN;
break;
}
+
+ normalize_eval_seqn(aTHX_ subname_sv);
subname_pv = SvPV(subname_sv, subname_len);
if (trace_level >= 2)
@@ -4306,7 +4307,7 @@
int len;
unsigned int fid = read_int();
unsigned int line = read_int();
- SV *caller_subname_sv = normalize_eval_seqn(aTHX_
read_str(aTHX_ tmp_str2_sv));
+ SV *caller_subname_sv = read_str(aTHX_ tmp_str2_sv);
unsigned int count = read_int();
NV incl_time = read_nv();
NV excl_time = read_nv();
@@ -4314,7 +4315,7 @@
NV scpu_time = read_nv();
NV reci_time = read_nv();
UV rec_depth = read_int();
- SV *called_subname_sv = normalize_eval_seqn(aTHX_
read_str(aTHX_ tmp_str1_sv));
+ SV *called_subname_sv = read_str(aTHX_ tmp_str1_sv);
if (cb) {
PUSHMARK(SP);
@@ -4339,6 +4340,9 @@
SPAGAIN;
break;
}
+
+ normalize_eval_seqn(aTHX_ caller_subname_sv);
+ normalize_eval_seqn(aTHX_ called_subname_sv);
if (trace_level >= 3)
logwarn("Sub %s called by %s %u:%u: count %d,
incl %"NVff", excl %"NVff", ucpu %"NVff" scpu %"NVff"\n",
--
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]