logging: add a performace log category
authorStefan Kost <ensonic@users.sf.net>
Mon, 29 Jun 2009 08:24:04 +0000 (11:24 +0300)
committerStefan Kost <ensonic@users.sf.net>
Mon, 29 Jun 2009 08:28:01 +0000 (11:28 +0300)
This category can be used to log slow code path and help auditing the
performance. Add FIXME-0.11 to some questionable categories.

gst/gst_private.h
gst/gstinfo.c
gst/gstminiobject.c
libs/gst/base/gstadapter.c
win32/common/libgstreamer.def

index 0c5bddf..9fcff2f 100644 (file)
@@ -122,8 +122,8 @@ gboolean            gst_registry_binary_write_cache (GstRegistry * registry, const char *
 #ifndef GST_REMOVE_GST_DEBUG
 
 GST_EXPORT GstDebugCategory *GST_CAT_GST_INIT;
-GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG;
-GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG_ATTEMPT;
+GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG; /* FIXME 0.11: remove? */
+GST_EXPORT GstDebugCategory *GST_CAT_AUTOPLUG_ATTEMPT; /* FIXME 0.11: remove? */
 GST_EXPORT GstDebugCategory *GST_CAT_PARENTAGE;
 GST_EXPORT GstDebugCategory *GST_CAT_STATES;
 GST_EXPORT GstDebugCategory *GST_CAT_SCHEDULING;
@@ -134,6 +134,7 @@ GST_EXPORT GstDebugCategory *GST_CAT_CAPS;
 GST_EXPORT GstDebugCategory *GST_CAT_CLOCK;
 GST_EXPORT GstDebugCategory *GST_CAT_ELEMENT_PADS;
 GST_EXPORT GstDebugCategory *GST_CAT_PADS;
+GST_EXPORT GstDebugCategory *GST_CAT_PERFORMANCE;
 GST_EXPORT GstDebugCategory *GST_CAT_PIPELINE;
 GST_EXPORT GstDebugCategory *GST_CAT_PLUGIN_LOADING;
 GST_EXPORT GstDebugCategory *GST_CAT_PLUGIN_INFO;
@@ -168,6 +169,7 @@ GST_EXPORT GstDebugCategory *GST_CAT_TYPES; /* FIXME 0.11: remove? */
 #define GST_CAT_CLOCK            NULL
 #define GST_CAT_ELEMENT_PADS     NULL
 #define GST_CAT_PADS             NULL
+#define GST_CAT_PERFORMANCE      NULL
 #define GST_CAT_PIPELINE         NULL
 #define GST_CAT_PLUGIN_LOADING   NULL
 #define GST_CAT_PLUGIN_INFO      NULL
index b9f6cd0..e5f8243 100644 (file)
@@ -147,6 +147,7 @@ GstDebugCategory *GST_CAT_CAPS = NULL;
 GstDebugCategory *GST_CAT_CLOCK = NULL;
 GstDebugCategory *GST_CAT_ELEMENT_PADS = NULL;
 GstDebugCategory *GST_CAT_PADS = NULL;
+GstDebugCategory *GST_CAT_PERFORMANCE = NULL;
 GstDebugCategory *GST_CAT_PIPELINE = NULL;
 GstDebugCategory *GST_CAT_PLUGIN_LOADING = NULL;
 GstDebugCategory *GST_CAT_PLUGIN_INFO = NULL;
@@ -358,6 +359,8 @@ _gst_debug_init (void)
   GST_CAT_ELEMENT_PADS = _gst_debug_category_new ("GST_ELEMENT_PADS",
       GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED, NULL);
   GST_CAT_PADS = _gst_debug_category_new ("GST_PADS",
+      GST_DEBUG_BOLD | GST_DEBUG_FG_RED | GST_DEBUG_BG_RED, NULL);
+  GST_CAT_PERFORMANCE = _gst_debug_category_new ("GST_PERFORMANCE",
       GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED, NULL);
   GST_CAT_PIPELINE = _gst_debug_category_new ("GST_PIPELINE",
       GST_DEBUG_BOLD | GST_DEBUG_FG_WHITE | GST_DEBUG_BG_RED, NULL);
index 2386dba..a219959 100644 (file)
@@ -275,6 +275,7 @@ gst_mini_object_make_writable (GstMiniObject * mini_object)
   if (gst_mini_object_is_writable (mini_object)) {
     ret = (GstMiniObject *) mini_object;
   } else {
+    GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "copy miniobject");
     ret = gst_mini_object_copy (mini_object);
     gst_mini_object_unref ((GstMiniObject *) mini_object);
   }
index 4c69e4d..3c44e8e 100644 (file)
  * Last reviewed on 2009-05-13 (0.10.24).
  */
 
-
+#include <gst/gst_private.h>
 #include "gstadapter.h"
 #include <string.h>
 
@@ -421,6 +421,7 @@ gst_adapter_peek (GstAdapter * adapter, guint size)
   }
   adapter->assembled_len = size;
 
+  GST_CAT_DEBUG (GST_CAT_PERFORMANCE, "copy data from adapter");
   copy_into_unchecked (adapter, adapter->assembled_data, skip, size);
 
   return adapter->assembled_data;
index 070c64f..c737da9 100644 (file)
@@ -17,6 +17,7 @@ EXPORTS
        GST_CAT_PADS DATA
        GST_CAT_PARAMS DATA
        GST_CAT_PARENTAGE DATA
+       GST_CAT_PERFORMANCE DATA
        GST_CAT_PIPELINE DATA
        GST_CAT_PLUGIN_INFO DATA
        GST_CAT_PLUGIN_LOADING DATA