On Wed Mar 04 07:59:01 2009, Tim.Bunce@pobox.com wrote:
Show quoted text> Can you produce a small test case I can reproduce?
I'll try. The program in question uses over 70 first-level perl modules
(not sure how many dependencies these have). Actually, now I read on
your example works - see below:
Show quoted text> > Enabling trace provides a lot of output but nearly all of it is like
> the
> > following repeated:
> >
> > start_cop_of_context: can't find next cop for LOOP line 65
>
> Setting the blocks=0 option should silence those.
> Also, you'd need trace=2 to see the lines I'm looking for:
cd /tmp
mkdir p
cd p
mkdir nytprof
NYTPROF=trace=2:blocks=0 perl -d:NYTProf -e 'use POSIX;' >x.x 2>&1
cat x.x:
# trace=2
# blocks=0
NYTProf init pid 8902, clock 1
Opened nytprof.out
NYTProf enable_profile (previously disabled) to nytprof.out at
/usr/lib/perl5/si
te_perl/5.8.8/i386-linux-thread-multi/Devel/NYTProf.pm line 43.
NYTProf pid 8902: first statement line 1 of -e at -e line 1.
New fid 1 (after 0:1 ) 2 e0:0 -e , with src
New fid 2 (after 1:7 ) 2 e0:0
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/P
OSIX.pm
New fid 3 (after 2:3 ) 2 e0:0 /usr/lib/perl5/5.8.8/AutoLoader.pm
New fid 4 (after 3:3 ) 2 e0:0 /usr/lib/perl5/5.8.8/strict.pm
New fid 5 (after 3:159 ) 2 e0:0
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/a
uto/POSIX/autosplit.ix
New fid 6 (after 3:961 ) 2 e0:0 ../../lib/POSIX.pm
/tmp/t/../../lib/POSIX.pm
New fid 7 (after 6:3 ) 2 e0:0 /usr/lib/perl5/5.8.8/Exporter.pm
finish_profile (last_pid 8902, getpid 8902, overhead 0.003677s,
is_profiling 1)
NYTProf disable_profile (previously enabled).
writing sub line ranges
New fid 8 (after 1:1 ) 4 e0:0
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/X
SLoader.pm
Sub
POSIX::__ANON__[/usr/lib/perl5/5.8.8/i386-linux-thread-multi/POSIX.pm:48] fi
d 2 lines 48..48
Sub POSIX::load_imports fid 6 lines 743..958
Sub strict::unimport fid 4 lines 32..35
Sub POSIX::SigAction::new fid 2 lines 57..57
Sub Exporter::export fid 7 lines 25..27
Sub Exporter::export_ok_tags fid 7 lines 87..89
Sub Exporter::export_fail fid 7 lines 70..73
Sub AutoLoader::import fid 3 lines 119..168
Sub XSLoader::load fid 8 lines 22..100
Sub POSIX::BEGIN fid 2 lines 9..9
Sub POSIX::croak fid 2 lines 22..22
Sub Exporter::export_to_level fid 7 lines 79..81
Sub Exporter::as_heavy fid 7 lines 16..23
Sub AutoLoader::BEGIN fid 3 lines 173..173
Sub Exporter::export_tags fid 7 lines 83..85
Sub Exporter::require_version fid 7 lines 91..93
Sub
POSIX::__ANON__[/usr/lib/perl5/5.8.8/i386-linux-thread-multi/POSIX.pm:44] fi
d 2 lines 44..44
Sub POSIX::AUTOLOAD fid 2 lines 32..52
Sub POSIX::import fid 2 lines 14..20
Sub strict::bits fid 4 lines 11..23
Sub XSLoader::bootstrap_inherit fid 8 lines 103..112
Sub AutoLoader::__ANON__[/usr/lib/perl5/5.8.8/AutoLoader.pm:96] fid 3
lines 96..
96
Sub AutoLoader::AUTOLOAD fid 3 lines 21..117
Sub Exporter::import fid 7 lines 29..66
Sub AutoLoader::unimport fid 3 lines 170..177
Sub Exporter::__ANON__[/usr/lib/perl5/5.8.8/Exporter.pm:63] fid 7 lines
63..63
Sub main::BEGIN fid 1 lines 1..1
Sub strict::import fid 4 lines 27..30
Sub POSIX::SigAction::BEGIN fid 2 lines 56..56
writing sub callers
NOTE
ls ../../lib/POSIX.pm
ls: ../../lib/POSIX.pm: No such file or directory
ls /tmp/t/../../lib/POSIX.pm
ls: /tmp/t/../../lib/POSIX.pm: No such file or directory
Show quoted text> It's that "New fid" message for ../POSIX.pm I'd like to see.
Hopefully you have it.
Show quoted text> Also, later, try setting savesrc=1 - it might avoid the problem by
> storing the source of POSIX.pm into the profile data file. (Though I'm
> not sure it works for perl 5.8.8.)
>
Still in /tmp/t
unset PERL5LIB # just in case it is affecting anything
NYTPROF=savesrc=1 perl -d:NYTProf -e 'use POSIX;'
nytprofhtml -o nytprof
Generating report...
Reading nytprof.out
Writing report to nytprof directory
Unable to open '/tmp/t/../../lib/POSIX.pm' for reading: No such file or
directory. Try running /usr/bin/nytprofhtml in the same directory as you
ran Devel::NYTProf, or ensure @INC is correct.
Unable to open '-e' for reading: No such file or directory.
Martin
--
Martin J. Evans
Wetherby, UK