home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.0 / 7.0.157 < prev    next >
Encoding:
Internet Message Format  |  2006-10-31  |  3.5 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.0.157
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.0.157
  11. Problem:    When a function is used recursively the profiling information is
  12.         invalid. (Mikolaj Machowski)
  13. Solution:   Put the start time on the stack instead of in the function.
  14. Files:        src/eval.c
  15.  
  16.  
  17. *** ../vim-7.0.156/src/eval.c    Wed Nov  1 15:31:02 2006
  18. --- src/eval.c    Wed Nov  1 13:39:52 2006
  19. ***************
  20. *** 166,172 ****
  21.       int        uf_tm_count;    /* nr of calls */
  22.       proftime_T    uf_tm_total;    /* time spend in function + children */
  23.       proftime_T    uf_tm_self;    /* time spend in function itself */
  24. -     proftime_T    uf_tm_start;    /* time at function call */
  25.       proftime_T    uf_tm_children;    /* time spent in children this call */
  26.       /* profiling the function per line */
  27.       int        *uf_tml_count;    /* nr of times line was executed */
  28. --- 166,171 ----
  29. ***************
  30. *** 19764,19769 ****
  31. --- 19763,19769 ----
  32.       char_u    *name;
  33.   #ifdef FEAT_PROFILE
  34.       proftime_T    wait_start;
  35. +     proftime_T    call_start;
  36.   #endif
  37.   
  38.       /* If depth of calling is getting too high, don't execute the function */
  39. ***************
  40. *** 19943,19949 ****
  41.                  || (fc.caller != NULL && &fc.caller->func->uf_profiling))
  42.       {
  43.           ++fp->uf_tm_count;
  44. !         profile_start(&fp->uf_tm_start);
  45.           profile_zero(&fp->uf_tm_children);
  46.       }
  47.       script_prof_save(&wait_start);
  48. --- 19943,19949 ----
  49.                  || (fc.caller != NULL && &fc.caller->func->uf_profiling))
  50.       {
  51.           ++fp->uf_tm_count;
  52. !         profile_start(&call_start);
  53.           profile_zero(&fp->uf_tm_children);
  54.       }
  55.       script_prof_save(&wait_start);
  56. ***************
  57. *** 19973,19986 ****
  58.       if (do_profiling == PROF_YES && (fp->uf_profiling
  59.               || (fc.caller != NULL && &fc.caller->func->uf_profiling)))
  60.       {
  61. !     profile_end(&fp->uf_tm_start);
  62. !     profile_sub_wait(&wait_start, &fp->uf_tm_start);
  63. !     profile_add(&fp->uf_tm_total, &fp->uf_tm_start);
  64. !     profile_self(&fp->uf_tm_self, &fp->uf_tm_start, &fp->uf_tm_children);
  65.       if (fc.caller != NULL && &fc.caller->func->uf_profiling)
  66.       {
  67. !         profile_add(&fc.caller->func->uf_tm_children, &fp->uf_tm_start);
  68. !         profile_add(&fc.caller->func->uf_tml_children, &fp->uf_tm_start);
  69.       }
  70.       }
  71.   #endif
  72. --- 19973,19986 ----
  73.       if (do_profiling == PROF_YES && (fp->uf_profiling
  74.               || (fc.caller != NULL && &fc.caller->func->uf_profiling)))
  75.       {
  76. !     profile_end(&call_start);
  77. !     profile_sub_wait(&wait_start, &call_start);
  78. !     profile_add(&fp->uf_tm_total, &call_start);
  79. !     profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children);
  80.       if (fc.caller != NULL && &fc.caller->func->uf_profiling)
  81.       {
  82. !         profile_add(&fc.caller->func->uf_tm_children, &call_start);
  83. !         profile_add(&fc.caller->func->uf_tml_children, &call_start);
  84.       }
  85.       }
  86.   #endif
  87. *** ../vim-7.0.156/src/version.c    Wed Nov  1 18:10:36 2006
  88. --- src/version.c    Wed Nov  1 18:32:42 2006
  89. ***************
  90. *** 668,669 ****
  91. --- 668,671 ----
  92.   {   /* Add new patch number below this line */
  93. + /**/
  94. +     157,
  95.   /**/
  96.  
  97. -- 
  98. hundred-and-one symptoms of being an internet addict:
  99. 140. You'd rather catch a score on the web than watch the game as
  100.      it is being played on tv.
  101.  
  102.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  103. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  104. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  105.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  106.