Revision: 915
Author: tim.bunce
Date: Tue Nov 17 13:03:49 2009
Log: Fixed extra newlines in trace message showing saved source code.
Removed (single) requirement for Test::More 0.84.
Document that NYTProf isn't multiplicity-safe.

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

Modified:
  /trunk/NYTProf.xs
  /trunk/lib/Devel/NYTProf/PgPLPerl.pm
  /trunk/lib/Devel/NYTProf.pm
  /trunk/t/22-readstream.t

=======================================
--- /trunk/NYTProf.xs   Mon Nov 16 04:52:55 2009
+++ /trunk/NYTProf.xs   Tue Nov 17 13:03:49 2009
@@ -3121,7 +3121,7 @@
  #endif

      if (trace_level)
-        logwarn("~ init_profiler for pid %d, clock %d, start %d,  
perldb %lx\n",
+        logwarn("~ init_profiler for pid %d, clock %d, start %d, perldb  
0x%lx\n",
              last_pid, profile_clock, profile_start, PL_perldb);

      if (get_hv("DB::sub", 0) == NULL) {
@@ -3564,8 +3564,10 @@
              output_tag_int(NYTP_TAG_SRC_LINE, e->id);
              output_int(line);
              output_str(src, (I32)len);    /* includes newline */
-            if (trace_level >= 5)
-                logwarn("fid %d src line %d: %s\n", e->id, line, src);
+            if (trace_level >= 5) {
+                logwarn("fid %d src line %d: %s%s", e->id, line, src,
+                    (*src && src[strlen(src)-1]!=='\n') ? "\n" : "");
+            }
              ++t_lines;
          }
      }
=======================================
--- /trunk/lib/Devel/NYTProf/PgPLPerl.pm        Fri Oct  2 05:31:46 2009
+++ /trunk/lib/Devel/NYTProf/PgPLPerl.pm        Tue Nov 17 13:03:49 2009
@@ -67,12 +67,20 @@

  =head2 Explicit call to finish_profile needed

-Currently postgres doesn't execute END blocks when it shuts down, so  
NYTProf
+Postgres <= 8.4 doesn't execute END blocks when it shuts down, so NYTProf
  doesn't get a chance to terminate the profile cleanly. To get a useable  
profile
  you need to explicitly call finish_profile() in your plperl code.

  I've submitted a bug report asking for END blocks to be run at shutdown:
  http://archives.postgresql.org/pgsql-bugs/2009-09/threads.php#00289
+and I'm working on a patch to fix that and make other improvements to  
plperl.
+
+=head2 Can't use plperl and plperlu at the same time
+
+Postgres uses separate Perl interpreters for the plperl and plperlu  
languages.
+NYTProf is not multiplicity safe so if you call functions implemented in  
the
+plperl and plperlu languages in the same session, while using NYTProf,  
you're
+likely to get garbage or worse.

  =head1 SEE ALSO

=======================================
--- /trunk/lib/Devel/NYTProf.pm Mon Nov 16 13:32:31 2009
+++ /trunk/lib/Devel/NYTProf.pm Tue Nov 17 13:03:49 2009
@@ -554,10 +554,11 @@

  =head1 LIMITATIONS

-=head2 threads
-
-C<Devel::NYTProf> is not currently thread safe. If you'd be interested in
-helping to make it thread safe then please get in touch with us.
+=head2 Threads and Multiplicity
+
+C<Devel::NYTProf> is not currently thread safe or multiplicity safe.
+If you'd be interested in helping to fix that then please get in
+touch with us.

  =head2 For perl < 5.8.8 it may change what caller() returns

=======================================
--- /trunk/t/22-readstream.t    Sat Oct 24 08:56:24 2009
+++ /trunk/t/22-readstream.t    Tue Nov 17 13:03:49 2009
@@ -1,4 +1,4 @@
-use Test::More 0.84;
+use Test::More;

  use strict;
  use lib qw(t/lib);
@@ -25,7 +25,7 @@
      push @seqn, "$.";
      my $tag = shift;
      push @{ $prof{$tag} }, [ @_ ];
-    if (1) { chomp @_; note("$. $tag @_"); }
+    if (1) { chomp @_; print "# $. $tag @_\n"; }
  } filename => $out;

  ok scalar @seqn, 'should have read chunks';

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