Author: tim.bunce
Date: Wed Nov 19 05:44:41 2008
New Revision: 614

Modified:
    trunk/NYTProf.xs
    trunk/lib/Devel/NYTProf/FileInfo.pm

Log:
Make delete_subs_called_info() adjust total_sub_calls attribute
(and so enable test14 to pass with different versions of AutoLoader)


Modified: trunk/NYTProf.xs
==============================================================================
--- trunk/NYTProf.xs    (original)
+++ trunk/NYTProf.xs    Wed Nov 19 05:44:41 2008
@@ -101,6 +101,15 @@
  #define NYTP_FIDi_SUBS_DEFINED  10
  #define NYTP_FIDi_SUBS_CALLED   11

+/* indices to elements of the sub call info array */
+#define NYTP_SCi_CALL_COUNT  0   /* count of calls to sub */
+#define NYTP_SCi_INCL_RTIME  1   /* inclusive real time in sub */
+#define NYTP_SCi_EXCL_RTIME  2   /* exclusive real time in sub */
+#define NYTP_SCi_INCL_UTIME  3   /* incl user cpu time in sub */
+#define NYTP_SCi_INCL_STIME  4   /* incl sys  cpu time in sub */
+#define NYTP_SCi_RECI_RTIME  5   /* recursive incl real time in sub */
+#define NYTP_SCi_REC_DEPTH   6   /* max recursion call depth */
+#define NYTP_SCi_elements    7   /* highest index, plus 1 */

  /* Hash table definitions */
  #define MAX_HASH_SIZE 512
@@ -1844,15 +1853,6 @@
  /******************************************
   * Sub caller and inclusive time tracking
   ******************************************/
-
-#define NYTP_SCi_CALL_COUNT  0   /* count of calls to sub */
-#define NYTP_SCi_INCL_RTIME  1   /* inclusive real time in sub */
-#define NYTP_SCi_EXCL_RTIME  2   /* exclusive real time in sub */
-#define NYTP_SCi_INCL_UTIME  3   /* incl user cpu time in sub */
-#define NYTP_SCi_INCL_STIME  4   /* incl sys  cpu time in sub */
-#define NYTP_SCi_RECI_RTIME  5   /* recursive incl real time in sub */
-#define NYTP_SCi_REC_DEPTH   6   /* max recursion call depth */
-#define NYTP_SCi_elements    7   /* highest index, plus 1 */

  static AV *
  new_sub_call_info_av(pTHX)

Modified: trunk/lib/Devel/NYTProf/FileInfo.pm
==============================================================================
--- trunk/lib/Devel/NYTProf/FileInfo.pm (original)
+++ trunk/lib/Devel/NYTProf/FileInfo.pm Wed Nov 19 05:44:41 2008
@@ -122,8 +122,14 @@
      my $sub_caller = $profile->{sub_caller}
          or return;
      my $fid = $self->fid;
+    my $total_sub_calls = 0;
      # remove sub_caller info for calls made *from within* this file
-    delete $_->{$fid} for values %$sub_caller;
+    for my $sci (values %$sub_caller) {
+        my $info = delete $sci->{$fid};
+        # NYTP_SCi_CALL_COUNT
+        $total_sub_calls += $_->[0] for values %$info;
+    }
+    $profile->{attribute}{total_sub_calls} -= $total_sub_calls;
      return;
  }


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