]> git.sesse.net Git - vlc/commitdiff
module: Set up a timer for moduleNeed().
authorPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 15 Apr 2008 17:31:28 +0000 (19:31 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 15 Apr 2008 17:40:25 +0000 (19:40 +0200)
include/vlc_messages.h
src/modules/modules.c

index 5da632a5a72cbd4949ea7f10f7a01aba2dd4b04c..d8b7b3806f3773f4750016643d589cbd861edfbb 100644 (file)
@@ -230,6 +230,7 @@ enum
     STATS_TIMER_INTERACTION,
     STATS_TIMER_PREPARSE,
     STATS_TIMER_INPUT_LAUNCHING,
+    STATS_TIMER_MODULE_NEED,
 
     STATS_TIMER_SKINS_PLAYTREE_IMAGE,
 };
index cc765063e78e771f03eec4187e7aaa4d7498c3e8..7d7f87307da12a5ecddc015c566c2772a266977a 100644 (file)
@@ -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;
 }