gstreamer_core/gst/gsttrace.h
changeset 8 4a7fac7dd34a
parent 0 0e761a78d257
child 10 6f340f756486
equal deleted inserted replaced
7:71e347f905f2 8:4a7fac7dd34a
    90 #ifdef __SYMBIAN32__
    90 #ifdef __SYMBIAN32__
    91 IMPORT_C
    91 IMPORT_C
    92 #endif
    92 #endif
    93 
    93 
    94 
    94 
    95 
       
    96 
       
    97 GstTrace*	gst_trace_new			(gchar *filename, gint size);
    95 GstTrace*	gst_trace_new			(gchar *filename, gint size);
    98 #ifdef __SYMBIAN32__
    96 #ifdef __SYMBIAN32__
    99 IMPORT_C
    97 IMPORT_C
   100 #endif
    98 #endif
   101 
    99 
   144 IMPORT_C
   142 IMPORT_C
   145 #endif
   143 #endif
   146 
   144 
   147 
   145 
   148 void 		gst_trace_read_tsc		(gint64 *dst);
   146 void 		gst_trace_read_tsc		(gint64 *dst);
   149 #ifdef __SYMBIAN32__
   147 
   150 IMPORT_C
   148 
   151 #endif
   149 extern GStaticMutex     _gst_trace_mutex;
   152 
   150 #ifdef __SYMBIAN32__
       
   151 IMPORT_C
       
   152 #endif
   153 
   153 
   154 
   154 
   155 gboolean		gst_alloc_trace_available	(void);
   155 gboolean		gst_alloc_trace_available	(void);
   156 #ifdef __SYMBIAN32__
   156 #ifdef __SYMBIAN32__
   157 IMPORT_C
   157 IMPORT_C
   218  *
   218  *
   219  * Use the tracer to trace a new memory allocation
   219  * Use the tracer to trace a new memory allocation
   220  */
   220  */
   221 #define	gst_alloc_trace_new(trace, mem) 		\
   221 #define	gst_alloc_trace_new(trace, mem) 		\
   222 G_STMT_START {						\
   222 G_STMT_START {						\
   223   if ((trace)->flags & GST_ALLOC_TRACE_LIVE) 		\
   223   if (G_UNLIKELY ((trace)->flags)) {                    \
   224     (trace)->live++;					\
   224     g_static_mutex_lock (&_gst_trace_mutex);            \
   225   if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) 	\
   225     if ((trace)->flags & GST_ALLOC_TRACE_LIVE) 		\
   226     (trace)->mem_live = 				\
   226       (trace)->live++;					\
   227       g_slist_prepend ((trace)->mem_live, mem);		\
   227     if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) 	\
       
   228       (trace)->mem_live = 				\
       
   229         g_slist_prepend ((trace)->mem_live, mem);	\
       
   230     g_static_mutex_unlock (&_gst_trace_mutex);          \
       
   231   }                                                     \
   228 } G_STMT_END
   232 } G_STMT_END
   229 
   233 
   230 /**
   234 /**
   231  * gst_alloc_trace_free:
   235  * gst_alloc_trace_free:
   232  * @trace: The tracer to use
   236  * @trace: The tracer to use
   234  *
   238  *
   235  * Trace a memory free operation
   239  * Trace a memory free operation
   236  */
   240  */
   237 #define	gst_alloc_trace_free(trace, mem) 		\
   241 #define	gst_alloc_trace_free(trace, mem) 		\
   238 G_STMT_START {						\
   242 G_STMT_START {						\
   239   if ((trace)->flags & GST_ALLOC_TRACE_LIVE) 		\
   243   if (G_UNLIKELY ((trace)->flags)) {                    \
   240     (trace)->live--;					\
   244     g_static_mutex_lock (&_gst_trace_mutex);            \
   241   if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) 	\
   245     if ((trace)->flags & GST_ALLOC_TRACE_LIVE) 		\
   242     (trace)->mem_live = 				\
   246       (trace)->live--;					\
   243       g_slist_remove ((trace)->mem_live, mem); 		\
   247     if ((trace)->flags & GST_ALLOC_TRACE_MEM_LIVE) 	\
       
   248       (trace)->mem_live = 				\
       
   249         g_slist_remove ((trace)->mem_live, mem); 	\
       
   250     g_static_mutex_unlock (&_gst_trace_mutex);          \
       
   251   }                                                     \
   244 } G_STMT_END
   252 } G_STMT_END
   245 
   253 
   246 #else
   254 #else
   247 #define	gst_alloc_trace_register(name) (NULL)
   255 #define	gst_alloc_trace_register(name) (NULL)
   248 #define	gst_alloc_trace_new(trace, mem)
   256 #define	gst_alloc_trace_new(trace, mem)