[vlc-devel] commit: module: Set up a timer for moduleNeed(). (Pierre d'Herbemont )

git version control git at videolan.org
Tue Apr 15 19:39:59 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Tue Apr 15 19:31:28 2008 +0200| [21c90595e35c7230a3e083087d3489a308866ac6]

module: Set up a timer for moduleNeed().

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=21c90595e35c7230a3e083087d3489a308866ac6
---

 include/vlc_messages.h |    1 +
 src/modules/modules.c  |    9 +++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/vlc_messages.h b/include/vlc_messages.h
index 5da632a..d8b7b38 100644
--- a/include/vlc_messages.h
+++ b/include/vlc_messages.h
@@ -230,6 +230,7 @@ enum
     STATS_TIMER_INTERACTION,
     STATS_TIMER_PREPARSE,
     STATS_TIMER_INPUT_LAUNCHING,
+    STATS_TIMER_MODULE_NEED,
 
     STATS_TIMER_SKINS_PLAYTREE_IMAGE,
 };
diff --git a/src/modules/modules.c b/src/modules/modules.c
index cc76506..7d7f873 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -355,6 +355,8 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
 {
     typedef struct module_list_t module_list_t;
 
+    stats_TimerStart( p_this, "module_Need()", STATS_TIMER_MODULE_NEED );
+
     struct module_list_t
     {
         module_t *p_module;
@@ -394,6 +396,9 @@ module_t * __module_Need( vlc_object_t *p_this, const char *psz_capability,
         if( !strcmp( psz_name, "none" ) )
         {
             free( psz_var );
+            stats_TimerStop( p_this, STATS_TIMER_MODULE_NEED );
+            stats_TimerDump( p_this, STATS_TIMER_MODULE_NEED );
+            stats_TimerClean( p_this, STATS_TIMER_MODULE_NEED );
             return NULL;
         }
 
@@ -647,6 +652,10 @@ found_shortcut:
     free( psz_shortcuts );
     free( psz_var );
 
+    stats_TimerStop( p_this, STATS_TIMER_MODULE_NEED );
+    stats_TimerDump( p_this, STATS_TIMER_MODULE_NEED );
+    stats_TimerClean( p_this, STATS_TIMER_MODULE_NEED );
+
     /* Don't forget that the module is still locked */
     return p_module;
 }




More information about the vlc-devel mailing list