Revision: 914 Author: tim.bunce Date: Mon Nov 16 13:32:31 2009 Log: Made trace first option in NYTPROF during tests, so other options get shown if trace is set. Made breakdown of test failures by option settings more visible in the test results. Added note that slowops that call subs currently appear as the caller in the call tree and that that's likely to change. Added tests for savesrc (using new simpler testing format).
http://code.google.com/p/perl-devel-nytprof/source/detail?r=914 Modified: /trunk/Changes /trunk/MANIFEST /trunk/lib/Devel/NYTProf/Run.pm /trunk/lib/Devel/NYTProf.pm /trunk/t/lib/NYTProfTest.pm ======================================= --- /trunk/Changes Mon Nov 16 04:52:55 2009 +++ /trunk/Changes Mon Nov 16 13:32:31 2009 @@ -7,12 +7,9 @@ =head2 Changes in Devel::NYTProf 2.11 XXX subroutine profiler docs need update -XXX should add test for embedded src code, incl string eval XXX handling of BEGIN's e.g., Perl::Critic::Document (1.105) line 325 -XXX test treemap? +XXX add u key to treemap to trigger moving 'up' a level XXX add "calls N subs" to treemap mouseover box -XXX Should slowops that call other code appear in call tree? -XXX test profiling code that has syntax errors Note: The file format has changed. Old files can't be read. ======================================= --- /trunk/MANIFEST Mon Nov 16 02:48:55 2009 +++ /trunk/MANIFEST Mon Nov 16 13:32:31 2009 @@ -52,6 +52,7 @@ t/22-readstream.t t/30-util.t t/31-env.t +t/40-savesrc.t t/50-errno.t t/60-forkdepth.t t/80-version.t ======================================= --- /trunk/lib/Devel/NYTProf/Run.pm Sat Nov 14 15:33:22 2009 +++ /trunk/lib/Devel/NYTProf/Run.pm Mon Nov 16 13:32:31 2009 @@ -49,6 +49,8 @@ my @perl = ($this_perl, '-d:NYTProf'); push @perl, @{ $opt{perl_opts} } if $opt{perl_opts}; + my $NYTPROF = $ENV{NYTPROF} || ''; + #warn "profile_this using [...@perl] with NYTPROF=$NYTPROF\n"; if (my $src_file = $opt{src_file}) { system(@perl, $src_file) == 0 ======================================= --- /trunk/lib/Devel/NYTProf.pm Wed Oct 28 09:11:41 2009 +++ /trunk/lib/Devel/NYTProf.pm Mon Nov 16 13:32:31 2009 @@ -415,6 +415,10 @@ The opcodes are currently profiled using their internal names, so C<printf> is C<prtf> and the C<-x> file test is C<fteexec>. This may change in future. +Opcodes that call subroutines, perhaps by triggering a FETCH from a tied +variable, currently appear in the call tree as the call of the sub. This is +likely to change in future. + =head2 usecputime=1 Measure user CPU + system CPU time instead of the real elapsed 'wall clock' ======================================= --- /trunk/t/lib/NYTProfTest.pm Mon Nov 16 03:45:46 2009 +++ /trunk/t/lib/NYTProfTest.pm Mon Nov 16 13:32:31 2009 @@ -125,7 +125,11 @@ my $prev_failures = count_of_failed_tests(); my %env = (%$env, %NYTPROF_TEST); - local $ENV{NYTPROF} = join ":", map {"$_=$env{$_}"} sort keys %env; + my @keys = sort keys %env; # put trace option first: + @keys = ('trace', grep { $_ ne 'trace' } @keys) if $env{trace}; + + local $ENV{NYTPROF} = join ":", map {"$_=$env{$_}"} @keys; + my $context = "NYTPROF=$ENV{NYTPROF}\n"; ($opts{v}) ? warn $context : print $context; @@ -147,6 +151,7 @@ # report which env vars influenced the failures, if any sub report_env_influence { my ($tag) = @_; + #warn Dumper(\%env_influence); my @env_influence; for my $envvar (sort keys %env_influence) { @@ -166,7 +171,7 @@ %env_influence = (); if (@env_influence and not defined wantarray) { - diag "Test failures of $tag related to settings:"; + diag "SUMMARY: Breakdown of $tag test failures by option settings:"; diag $_ for @env_influence; } -- 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]
