Author: tim.bunce
Date: Sun Jul 12 14:55:24 2009
New Revision: 825

Removed:
    trunk/t/22-readstream-v20.out
Modified:
    trunk/HACKING
    trunk/MANIFEST
    trunk/NYTProf.xs
    trunk/t/22-readstream.t

Log:
Renamed NYTP_TAG_SUB_LINE_RANGE to NYTP_TAG_SUB_INFO and future-proofed
the output format a little.
Deleted old t/22-readstream-v20.out that's no longer used.
Updated assorted entries in HACKING.


Modified: trunk/HACKING
==============================================================================
--- trunk/HACKING       (original)
+++ trunk/HACKING       Sun Jul 12 14:55:24 2009
@@ -185,8 +185,6 @@

  *** For core and reports

-Add NYTP_SIi_* constants for ::SubInfo array.
-
  Add @INC to data file so reports can be made more readable by removing
  (possibly very long) library paths where appropriate.
  Tricky thing is that @INC can change during the life of the program.
@@ -268,12 +266,16 @@
  (trace would certainly be useful).

  Add resolution of __ANON__ sub names (eg imported 'constants') where  
possible.
+[I can't recall what I meant by that now. I think this means where an anon  
sub
+has been imported, if the refcnt is 1 then use the imported name instead  
of the
+__ANON__ name.]

-Currently the line of only last BEGIN (or 'use') in the file are recorded.
+Currently the line of only the last BEGIN (or 'use') in the file are  
recorded.
  Rename Foo::BEGIN subs to Foo::BEGIN[file:line]
  (which matches the style used for Foo::__AUTO__[file:line])
-Probably need to record or output the line range when the BEGIN 'sub' is  
entered.
-Same for END subs.
+(perl ought to do this anyway but it seemed nontrivial when I looked)
+Probably need to record or output the line range when the BEGIN 'sub' is
+entered because it gets destroyed early.  Same for END subs.

  Record $AUTOLOAD when AUTOLOAD() called. Perhaps  
as ...::AUTOLOAD[$AUTOLOAD]
  Or perhaps just use the original name if the 'resolved' one is AUTOLOAD.
@@ -285,6 +287,10 @@
  timings based on what was in $sql because the code path was the same in  
both
  cases. (For sql DBI::Profile can be used, but the underlying issue is  
general.)

+The sub_caller information is currently one level deep. It would be good to
+make it two levels. Especially because it would allow you to "see through"
+AUTOLOADs and other kinds of 'dispatch' subs.
+
  Refactor this HACKING file!

  The data file includes the information mapping a line-level line to the
@@ -299,10 +305,6 @@

  Profile and optimize report generation

-The sub_caller information is currently one level deep. It would be good to
-make it two levels. Especially because it would allow you to "see through"
-AUTOLOADs and other kinds of 'dispatch' subs.
-
  Currently goto isn't explicitly noticed by the sub profiler. Need to  
intercept pp_goto.
  But that may be non-trivial. Could make it look like the statement that  
called
  the sub that called goto also called the sub that goto went to, or make it  
look
@@ -336,19 +338,14 @@

  called by list: "by $subname line $line of $file" make the file not  
include the inc portion

-Add caller sub name (via $profile->subname_at_file_line($fid, $line)) to  
sub
-caller info so report_src_line() doesn't have to do the expensive lookup.
-It's also a useful step on the road to the profiler storing the calling  
sub's
-name when generating the profile.
-
  Monitor and report when method cache is invalidated. Watch generation  
number
  and output a tag when it changes. Report locations of changes. Highlight  
those
  that happen after INIT phase.

  Fix testing of t/*.pm_x files which are currently being ignored.

-The autosplit handling doesn't address the naming of pseudo-fids from  
string
-evals, like "(eval 0)[test14.pm (autosplit into auto/test14/bar.al):17]"
+The autosplit handling doesn't address the naming of pseudo-fids from  
string evals
+inside autoloaded subs, like "(eval 0)[test14.pm (autosplit into  
auto/test14/bar.al):17]"
  The 'file name' for the eval fid needs to be edited when read in to remove  
the
  ' (autosplit...', but care should be taken to not remove the text for  
evals in
  autosplit files for which we've not been able to alias to the parent.

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST      (original)
+++ trunk/MANIFEST      Sun Jul 12 14:55:24 2009
@@ -35,7 +35,6 @@
  perftest.pl
  ppport.h
  t/00-load.t
-t/22-readstream-v20.out
  t/22-readstream.t
  t/30-util.t
  t/31-env.t

Modified: trunk/NYTProf.xs
==============================================================================
--- trunk/NYTProf.xs    (original)
+++ trunk/NYTProf.xs    Sun Jul 12 14:55:24 2009
@@ -95,7 +95,7 @@
  #define NYTP_TAG_DISCOUNT        '-'
  #define NYTP_TAG_NEW_FID         '@'
  #define NYTP_TAG_SRC_LINE        'S'    /* fid, line, str */
-#define NYTP_TAG_SUB_LINE_RANGE  's'
+#define NYTP_TAG_SUB_INFO        's'
  #define NYTP_TAG_SUB_CALLERS     'c'
  #define NYTP_TAG_PID_START       'P'
  #define NYTP_TAG_PID_END         'p'
@@ -3060,10 +3060,11 @@
              logwarn("Sub %s fid %u lines %lu..%lu\n",
                  sub_name, fid, (unsigned long)first_line, (unsigned  
long)last_line);

-        output_tag_int(NYTP_TAG_SUB_LINE_RANGE, fid);
+        output_tag_int(NYTP_TAG_SUB_INFO, fid);
+        output_str(sub_name, sub_name_len);
          output_int(first_line);
          output_int(last_line);
-        output_str(sub_name, sub_name_len);
+        output_int(0);  /* how many extra items follow */
      }
  }

@@ -3759,27 +3760,31 @@
                  break;
              }

-            case NYTP_TAG_SUB_LINE_RANGE:
+            case NYTP_TAG_SUB_INFO:
              {
                  AV *av;
                  SV *sv;
                  unsigned int fid        = read_int();
+                SV *subname_sv = normalize_eval_seqn(aTHX_ read_str(aTHX_  
tmp_str1_sv));
                  unsigned int first_line = read_int();
                  unsigned int last_line  = read_int();
                  int skip_subinfo_store = 0;
-                SV *subname_sv = normalize_eval_seqn(aTHX_ read_str(aTHX_  
tmp_str1_sv));
                  STRLEN subname_len;
                  char *subname_pv;
+                int extra_items = read_int();
+
+                while (extra_items-- > 0)
+                    (void)read_int();

                  if (cb) {
                      PUSHMARK(SP);

                      i = 0;
-                    sv_setpvs(cb_args[i], "SUB_LINE_RANGE");  
XPUSHs(cb_args[i++]);
-                    sv_setuv(cb_args[i], fid);                
XPUSHs(cb_args[i++]);
-                    sv_setuv(cb_args[i], first_line);         
XPUSHs(cb_args[i++]);
-                    sv_setuv(cb_args[i], last_line);          
XPUSHs(cb_args[i++]);
-                    sv_setsv(cb_args[i], subname_sv);         
XPUSHs(cb_args[i++]);
+                    sv_setpvs(cb_args[i], "SUB_INFO");  
XPUSHs(cb_args[i++]);
+                    sv_setuv(cb_args[i], fid);          
XPUSHs(cb_args[i++]);
+                    sv_setuv(cb_args[i], first_line);   
XPUSHs(cb_args[i++]);
+                    sv_setuv(cb_args[i], last_line);    
XPUSHs(cb_args[i++]);
+                    sv_setsv(cb_args[i], subname_sv);   
XPUSHs(cb_args[i++]);

                      PUTBACK;
                      call_sv(cb, G_DISCARD);

Modified: trunk/t/22-readstream.t
==============================================================================
--- trunk/t/22-readstream.t     (original)
+++ trunk/t/22-readstream.t     Sun Jul 12 14:55:24 2009
@@ -38,7 +38,7 @@
  # (but not START_DEFLATE as that'll be missing if there's no zlib)
  for my $tag (qw(
          COMMENT ATTRIBUTE DISCOUNT SRC_LINE TIME_BLOCK
-        SUB_LINE_RANGE SUB_CALLERS
+        SUB_INFO SUB_CALLERS
          PID_START PID_END NEW_FID
  )) {
      is ref $prof{$tag}[0], 'ARRAY', $tag;

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