On Tue, Jan 19, 2010 at 12:04:58PM +0000, Nicholas Clark wrote:
> I'm trying to get the merging more reliable. One problem is that there is some
> variance in which Perl files XS subroutines are assigned to. XSUBs don't
> carry filenames, so NYTProf tries to find "homes" for them by scanning
> %DB::sub, the debuggers subroutine->filename mapping hash, to identify
> (Perl) subroutines in the same package, and hence get a filename for them.
> The problem remaining is that sometimes the XSUB Storable::bootstrap is
> attributed to .../Storable.pm, and sometimes to (eval 7)[.../Storable.pm]
>
> It all depends on the order that %DB::sub returns results when it iterates.
>
> So I *assumed* that if I made that code skip anything that matches the
> eval "filename" pattern, it would solve this:
>
> However, it seems that this approach makes several unrelated tests fail:
>
> Test Summary Report
> -------------------
> t/test11.t (Wstat: 4096 Tests: 97 Failed: 16)
> Failed tests: 3, 9, 15, 21, 27, 33, 39, 45, 51, 57, 63
> 69, 75, 81, 87, 93
> Non-zero exit status: 16
> t/test22-strevala.t (Wstat: 4096 Tests: 49 Failed: 16)
> Failed tests: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33
> 36, 39, 42, 45, 48
> Non-zero exit status: 16
> t/test51-enable.t (Wstat: 4096 Tests: 145 Failed: 16)
> Failed tests: 3, 12, 21, 30, 39, 48, 57, 66, 75, 84, 93
> 102, 111, 120, 129, 138
> Non-zero exit status: 16
> t/test61-submerge.t (Wstat: 4096 Tests: 49 Failed: 16)
> Failed tests: 3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33
> 36, 39, 42, 45, 48
> Non-zero exit status: 16
>
>
> I'm not sure if this is because they are all assuming golden results, and
> I've just changed the ordering, or there is a more serious problem. My
> assumption was that any "eval" filename that exists has a corresponding
> real file to go with it, and that *that* file would get spotted later on
> in the %DB::sub iteration. So I'm not sure what to do here. Skipping "eval"
> filenames seems conceptually cleaner, but I don't understand *why* it causes
> breakage.
I added some logging to track every mapping generated by the each %DB::sub
loop in write_sub_line_ranges
fprintf(log, "%.*s => %.*s\n", (int)sub_name_len, sub_name,
(int)filename_len, filename);
The full diff has 4 hunks with a lot of lines repeated and is easily skimmable:
--- Passing 2010-01-20 15:06:59.000000000 +0000
+++ Failing 2010-01-20 14:57:36.000000000 +0000
@@ -207,22 +207,22 @@
main::BEGIN => test10.p
main::BEGIN => test10.p
main::BEGIN => test10.p
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
-main::__ANON__[(eval 1)[test11.p:3]:1] => (eval 1)[test11.p:3]
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
+main::BEGIN => test11.p
main::baz => test13.p
main::baz => test13.p
main::baz => test13.p
@@ -351,22 +351,22 @@
main::BEGIN => test21-streval3.p
main::BEGIN => test21-streval3.p
main::BEGIN => test21-streval3.p
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
-main::__ANON__[(eval 1)[test22-strevala.p:6]:1] => (eval
1)[test22-strevala.p:6]
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
+main::BEGIN => test22-strevala.p
main::prefork => test30-fork-0.p
main::prefork => test30-fork-0.p
main::prefork => test30-fork-0.p
@@ -415,22 +415,22 @@
test40pmc::foo => test40pmc.pm
test40pmc::foo => test40pmc.pm
test40pmc::foo => test40pmc.pm
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
-main::sub9 => (eval 9)[test51-enable.p:7]
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
+main::BEGIN => test51-enable.p
main::launch => test60-subname.p
Devel::NYTProf::Test::example_sub => ../blib/lib/Devel/NYTProf/Test.pm
main::launch => test60-subname.p
@@ -463,22 +463,22 @@
Devel::NYTProf::Test::example_sub => ../blib/lib/Devel/NYTProf/Test.pm
main::launch => test60-subname.p
Devel::NYTProf::Test::example_sub => ../blib/lib/Devel/NYTProf/Test.pm
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
-main::__ANON__[(eval 3)[test61-submerge.p:8]:1] => (eval
3)[test61-submerge.p:8]
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
+main::foo => test61-submerge.p
main::sub2 => test62-subcaller1.p
MyTie::FETCH => test62-subcaller1.p
Devel::NYTProf::Test::example_sub => ../blib/lib/Devel/NYTProf/Test.pm
ie the proposed change means *only* that package main:: in 4 cases goes
* from being mapped to a file name generated by an eval
* to being mapped to a file name on disk
which feels *right*.
So now I feel that I need to work out what the diff against all the test
results actually means.
Or should I just force the issue, by assuming that the new "got" is what
"expected" should be?
Nicholas Clark
--
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]