On Sat, Mar 07, 2009 at 03:05:15PM -0500, Andy Grundman wrote:
> On Mar 7, 2009, at 1:12 PM, Tim Bunce wrote:
> > On Fri, Mar 06, 2009 at 09:47:22AM -0800, Andy Grundman wrote:
> >> I need to use savesrc=1 to profile on an embedded platform.  This is
> >> running 5.10.0, so I have also enabled use_db_sub=1.  However, no
> >> source data is saved to the .out file.  I tried it on a 5.8.8 OSX
> >> system as well, and neither one appears to save the source.  Am I
> >> doing something wrong?
> >
> > Seems to work for me (with 5.10.0)...

> > Enabled:
> >
> > $ NYTPROF=trace=2:savesrc=1:use_db_sub=1 perl
> > -d:NYTProf -e 'use overload;' 2>&1 | grep 'New fid' && ls -l
> > nytprof.outNew fid  1 (after  0:1   ) 2 e0:0 -e , with src
> > New fid  2 (after  1:138 ) 2 e0:0 /usr/local/perl510-pure/lib/5.10.0/ 
> > overload.pm , with src
> > New fid  3 (after  2:3   ) 2 e0:0 /usr/local/perl510-pure/lib/5.10.0/ 
> > warnings/register.pm , with src
> > New fid  4 (after  3:9   ) 2 e0:0 /usr/local/perl510-pure/lib/5.10.0/ 
> > warnings.pm , with src
> > -rw-r-----  1 timbo  timbo  7736  7 Mar 18:11 nytprof.out
> >
> > Note the "with src" in the New fid lines, and the larger output file.
> 
> Ah yes, I am able to get source included with your example or with a  
> small test script that just loads a few modules.  However I still do  
> not get source with a very large app that is setup to exit after  
> loading everything.  I will try and narrow it down to a test case,  
> although this may be rather difficult...
> 
> Here's my output (trace not included as it's very large):

It would be useful to know what proportion of the 'New fid' lines have
'with src'.

> $ NYTPROF=savesrc=0:use_db_sub=1 perl -d:NYTProf slimserver.pl 2>&1 &&  
> ls -l nytprof.out
> -rw-r--r--  1 andy  andy  810272 Mar  7 14:58 nytprof.out
> 
> $ NYTPROF=savesrc=1:use_db_sub=1 perl -d:NYTProf slimserver.pl 2>&1 &&  
> ls -l nytprof.out
> -rw-r--r--  1 andy  andy  967107 Mar  7 14:59 nytprof.out
> 
> It is a bit larger but nowhere near large enough to contain all the  
> source compressed (the source is 6MB not including CPAN modules).

So the implication is that some files do have their src saved, and some
don't. So you need to look at the list of those that do and don't and try
to determine what's common about those that don't. Perhaps they're
loaded in a different way, or perhaps the 'with src' only applies to the
first N files. I don't know. Go dig! :)

> Unfortunately I run into another bug trying to run it without  
> compression (it dies on a 'use warnings'):
> 
> NYTPROF=savesrc=1:use_db_sub=1:compress=0 perl -d:NYTProf  
> slimserver.pl 2>&1 && ls -l nytprof.out
> fwrite error 2: No such file or directory at 
> /System/Library/Perl/5.8.8/warnings.pm line 134.
> BEGIN failed--compilation aborted at /System/Library/Perl/5.8.8/warnings.pm 
> line 134.
> 
> Line 134 is:
> use Carp ();
> 
> Anything helpful I can provide with trace output?

No need, I can reproduce it: 

NYTPROF=savesrc=1:use_db_sub=1:compress=0 perl -d:NYTProf -e 'use warnings;'
fwrite error 2: No such file or directory at 
/usr/local/perl58-i/lib/site_perl/5.8.6/darwin-thread-multi-2level/Devel/NYTProf.pm
 line 39.
BEGIN failed--compilation aborted at /usr/local/perl58-i/lib/5.8.6/warnings.pm 
line 134.

It's very odd that changing any of those three options makes the problem
go away. Very odd. I'll go dig...

Thanks.

Tim.

--~--~---------~--~----~------------~-------~--~----~
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]
-~----------~----~----~----~------~----~------~--~---

Reply via email to