Revision: 1176
Author: tim.bunce
Date: Mon Mar 22 15:08:29 2010
Log: Enabled savesrc=1 by default. Made 'read string' log less noisy. Tweaked some code indentation.

http://code.google.com/p/perl-devel-nytprof/source/detail?r=1176

Modified:
 /trunk/Changes
 /trunk/NYTProf.xs

=======================================
--- /trunk/Changes      Fri Mar 12 07:31:32 2010
+++ /trunk/Changes      Mon Mar 22 15:08:29 2010
@@ -13,6 +13,10 @@
 add "calls N subs" to treemap mouseover box
string eval merging - must allow at least viewing of source for called subs defined in a nested eval

+=head2 Changes in Devel::NYTProf 3.12 (svn XXXX)
+
+  Enabled savesrc=1 by default.
+
 =head2 Changes in Devel::NYTProf 3.11 (svn 1171) 12th March 2010

   Fixed assorted issues on Windows thanks to Jan Dubois.
=======================================
--- /trunk/NYTProf.xs   Fri Mar 12 02:35:37 2010
+++ /trunk/NYTProf.xs   Mon Mar 22 15:08:29 2010
@@ -212,7 +212,7 @@

 /* options and overrides */
 static char PROF_output_file[MAXPATHLEN+1] = "nytprof.out";
-static unsigned int profile_opts = NYTP_OPTf_OPTIMIZE;
+static unsigned int profile_opts = NYTP_OPTf_OPTIMIZE | NYTP_OPTf_SAVESRC;
static int profile_start = NYTP_START_BEGIN; /* when to start profiling */

 struct NYTP_int_options_t {
@@ -491,9 +491,16 @@
     if (NYTP_TAG_STRING_UTF8 == tag)
         SvUTF8_on(sv);

-    if (trace_level >= 5)
-        logwarn("  read string '%.*s'%s\n", (int)len, SvPV_nolen(sv),
-            (SvUTF8(sv)) ? " (utf8)" : "");
+    if (trace_level >= 19) {
+        STRLEN len2 = len;
+        char *newline = "";
+        if (buf[len2-1] == '\n') {
+            --len2;
+            newline = "\\n";
+        }
+        logwarn("  read string '%.*s%s'%s\n", (int)len2, SvPV_nolen(sv),
+            newline, (SvUTF8(sv)) ? " (utf8)" : "");
+    }

     return sv;
 }
@@ -3613,16 +3620,16 @@
         if (!state->fid_block_time_av)
             state->fid_block_time_av = newAV();
         add_entry(aTHX_ state->fid_block_time_av, file_num, block_line_num,
-                  seconds, eval_file_num, eval_line_num,
-                  1 - state->statement_discount
-            );
+                seconds, eval_file_num, eval_line_num,
+                1 - state->statement_discount
+        );

         if (!state->fid_sub_time_av)
             state->fid_sub_time_av = newAV();
         add_entry(aTHX_ state->fid_sub_time_av, file_num, sub_line_num,
-                  seconds, eval_file_num, eval_line_num,
-                  1 - state->statement_discount
-            );
+                seconds, eval_file_num, eval_line_num,
+                1 - state->statement_discount
+        );

         if (trace_level >= 4)
             logwarn("\tblock %u, sub %u\n", block_line_num, sub_line_num);

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

To unsubscribe from this group, send email to 
develnytprof-dev+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to