Delightfully simple :)
Thanks. Feel free to commit. A few words in the docs would be nice.
I'd also be grateful for a test (perhaps add a finish_profile(); foo();
enable_profile(); sequence in the middle of t/test51-enable.p)
but I'll add one if you don't have time.
Tim.
p.s. I'm taking the view that finish_profile() followed by
enable_profile() with no args overwrites the previous profile file.
On Tue, Apr 21, 2009 at 03:49:12AM -0700, Chia-liang Kao wrote:
>
> better patch allowing enable_profile() to be called after
> finish_profile().
>
> === NYTProf.xs
> ==================================================================
> --- NYTProf.xs (revision 13295)
> +++ NYTProf.xs (local)
> @@ -2393,11 +2393,6 @@
> /* enable the run-time aspects to profiling */
> int prev_is_profiling = is_profiling;
>
> - if (!out) {
> - warn("enable_profile: NYTProf not active");
> - return 0;
> - }
> -
> if (trace_level)
> warn("NYTProf enable_profile (previously %s) to %s",
> prev_is_profiling ? "enabled" : "disabled",
> @@ -2410,6 +2405,11 @@
> open_output_file(aTHX_ PROF_output_file);
> }
>
> + if (!out) {
> + warn("enable_profile: NYTProf not active");
> + return 0;
> + }
> +
> last_executed_fileptr = NULL; /* discard cached OutCopFILE */
> is_profiling = 1; /* enable NYTProf profilers */
> if (use_db_sub) /* set PL_DBsingle if required */
>
> >
--~--~---------~--~----~------------~-------~--~----~
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]
-~----------~----~----~----~------~----~------~--~---