tracing: rename the global api to gst_tracing

This makes it more obvious what is the api for tracer elements and what is api
for the global state.
This commit is contained in:
Stefan Sauer 2014-09-22 09:55:56 +02:00
parent d9901e7019
commit 660049bb38
8 changed files with 56 additions and 40 deletions

View file

@ -720,7 +720,7 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
GST_INFO ("initialized GStreamer successfully");
#ifndef GST_DISABLE_GST_DEBUG
_priv_gst_tracer_init ();
_priv_gst_tracing_init ();
#endif
return TRUE;
@ -957,7 +957,7 @@ gst_deinit (void)
return;
}
#ifndef GST_DISABLE_GST_DEBUG
_priv_gst_tracer_deinit ();
_priv_gst_tracing_deinit ();
#endif
g_thread_pool_set_max_unused_threads (0);

View file

@ -62,9 +62,9 @@ struct _GstTracerClass {
GType gst_tracer_get_type (void);
void gst_tracer_register_hook (GstTracer *tracer, const gchar *detail,
void gst_tracing_register_hook (GstTracer *tracer, const gchar *detail,
GCallback func);
void gst_tracer_register_hook_id (GstTracer *tracer, GQuark detail,
void gst_tracing_register_hook_id (GstTracer *tracer, GQuark detail,
GCallback func);
void gst_tracer_log_trace (GstStructure * s);

View file

@ -59,7 +59,7 @@ GHashTable *_priv_tracers = NULL;
/* Initialize the tracing system */
void
_priv_gst_tracer_init (void)
_priv_gst_tracing_init (void)
{
const gchar *env = g_getenv ("GST_TRACE");
@ -122,7 +122,7 @@ _priv_gst_tracer_init (void)
}
void
_priv_gst_tracer_deinit (void)
_priv_gst_tracing_deinit (void)
{
GList *h_list, *h_node, *t_node;
GstTracerHook *hook;
@ -146,8 +146,16 @@ _priv_gst_tracer_deinit (void)
_priv_tracers = NULL;
}
/**
* gst_tracing_register_hook_id:
* @tracer: the tracer
* @detail: the detailed hook
* @func: (scope async): the callback
*
* Register @func to be called when the trace hook @detail is getting invoked.
*/
void
gst_tracer_register_hook_id (GstTracer * tracer, GQuark detail, GCallback func)
gst_tracing_register_hook_id (GstTracer * tracer, GQuark detail, GCallback func)
{
gpointer key = GINT_TO_POINTER (detail);
GList *list = g_hash_table_lookup (_priv_tracers, key);
@ -162,11 +170,19 @@ gst_tracer_register_hook_id (GstTracer * tracer, GQuark detail, GCallback func)
_priv_tracer_enabled = TRUE;
}
/**
* gst_tracing_register_hook:
* @tracer: the tracer
* @detail: the detailed hook
* @func: (scope async): the callback
*
* Register @func to be called when the trace hook @detail is getting invoked.
*/
void
gst_tracer_register_hook (GstTracer * tracer, const gchar * detail,
gst_tracing_register_hook (GstTracer * tracer, const gchar * detail,
GCallback func)
{
gst_tracer_register_hook_id (tracer, g_quark_try_string (detail), func);
gst_tracing_register_hook_id (tracer, g_quark_try_string (detail), func);
}
#endif /* GST_DISABLE_GST_DEBUG */

View file

@ -34,8 +34,8 @@ G_BEGIN_DECLS
/* tracing hooks */
void _priv_gst_tracer_init (void);
void _priv_gst_tracer_deinit (void);
void _priv_gst_tracing_init (void);
void _priv_gst_tracing_deinit (void);
/* tracing modules */

View file

@ -227,18 +227,18 @@ static void
gst_latency_tracer_init (GstLatencyTracer * self)
{
GstTracer *tracer = GST_TRACER (self);
gst_tracer_register_hook (tracer, "pad-push-pre",
gst_tracing_register_hook (tracer, "pad-push-pre",
G_CALLBACK (do_push_buffer_pre));
gst_tracer_register_hook (tracer, "pad-push-list-pre",
gst_tracing_register_hook (tracer, "pad-push-list-pre",
G_CALLBACK (do_push_buffer_pre));
gst_tracer_register_hook (tracer, "pad-push-post",
gst_tracing_register_hook (tracer, "pad-push-post",
G_CALLBACK (do_push_buffer_post));
gst_tracer_register_hook (tracer, "pad-push-list-post",
gst_tracing_register_hook (tracer, "pad-push-list-post",
G_CALLBACK (do_push_buffer_post));
gst_tracer_register_hook (tracer, "pad-pull-range-pre",
gst_tracing_register_hook (tracer, "pad-pull-range-pre",
G_CALLBACK (do_pull_range_pre));
gst_tracer_register_hook (tracer, "pad-pull-range-post",
gst_tracing_register_hook (tracer, "pad-pull-range-post",
G_CALLBACK (do_pull_range_post));
gst_tracer_register_hook (tracer, "pad-push-event-pre",
gst_tracing_register_hook (tracer, "pad-push-event-pre",
G_CALLBACK (do_push_event_pre));
}

View file

@ -175,28 +175,28 @@ gst_log_tracer_init (GstLogTracer * self)
{
GstTracer *tracer = GST_TRACER (self);
gst_tracer_register_hook (tracer, "pad-push-pre",
gst_tracing_register_hook (tracer, "pad-push-pre",
G_CALLBACK (do_push_buffer_pre));
gst_tracer_register_hook (tracer, "pad-push-post",
gst_tracing_register_hook (tracer, "pad-push-post",
G_CALLBACK (do_push_buffer_post));
gst_tracer_register_hook (tracer, "pad-push-list-pre",
gst_tracing_register_hook (tracer, "pad-push-list-pre",
G_CALLBACK (do_push_buffer_list_pre));
gst_tracer_register_hook (tracer, "pad-push-list-post",
gst_tracing_register_hook (tracer, "pad-push-list-post",
G_CALLBACK (do_push_buffer_list_post));
gst_tracer_register_hook (tracer, "pad-pull-range-pre",
gst_tracing_register_hook (tracer, "pad-pull-range-pre",
G_CALLBACK (do_pull_range_pre));
gst_tracer_register_hook (tracer, "pad-pull-range-post",
gst_tracing_register_hook (tracer, "pad-pull-range-post",
G_CALLBACK (do_pull_range_post));
gst_tracer_register_hook (tracer, "pad-push-event-pre",
gst_tracing_register_hook (tracer, "pad-push-event-pre",
G_CALLBACK (do_push_event_pre));
gst_tracer_register_hook (tracer, "pad-push-event-post",
gst_tracing_register_hook (tracer, "pad-push-event-post",
G_CALLBACK (do_push_event_post));
gst_tracer_register_hook (tracer, "element-post-message-pre",
gst_tracing_register_hook (tracer, "element-post-message-pre",
G_CALLBACK (do_post_message_pre));
gst_tracer_register_hook (tracer, "element-post-message-post",
gst_tracing_register_hook (tracer, "element-post-message-post",
G_CALLBACK (do_post_message_post));
gst_tracer_register_hook (tracer, "element-query-pre",
gst_tracing_register_hook (tracer, "element-query-pre",
G_CALLBACK (do_query_pre));
gst_tracer_register_hook (tracer, "element-query-post",
gst_tracing_register_hook (tracer, "element-query-post",
G_CALLBACK (do_query_post));
}

View file

@ -347,7 +347,7 @@ gst_rusage_tracer_init (GstRUsageTracer * self)
{
GstTracer *tracer = GST_TRACER (self);
gst_tracer_register_hook_id (tracer, 0, G_CALLBACK (do_stats));
gst_tracing_register_hook_id (tracer, 0, G_CALLBACK (do_stats));
self->threads = g_hash_table_new_full (NULL, NULL, NULL, free_thread_stats);
self->tvs_proc = make_trace_values (GST_SECOND);

View file

@ -546,22 +546,22 @@ gst_stats_tracer_init (GstStatsTracer * self)
{
GstTracer *tracer = GST_TRACER (self);
gst_tracer_register_hook (tracer, "pad-push-pre",
gst_tracing_register_hook (tracer, "pad-push-pre",
G_CALLBACK (do_push_buffer_pre));
gst_tracer_register_hook (tracer, "pad-push-post",
gst_tracing_register_hook (tracer, "pad-push-post",
G_CALLBACK (do_push_buffer_post));
gst_tracer_register_hook (tracer, "pad-push-list-pre",
gst_tracing_register_hook (tracer, "pad-push-list-pre",
G_CALLBACK (do_push_buffer_list_pre));
gst_tracer_register_hook (tracer, "pad-push-list-post",
gst_tracing_register_hook (tracer, "pad-push-list-post",
G_CALLBACK (do_push_buffer_list_post));
gst_tracer_register_hook (tracer, "pad-pull-range-pre",
gst_tracing_register_hook (tracer, "pad-pull-range-pre",
G_CALLBACK (do_pull_range_pre));
gst_tracer_register_hook (tracer, "pad-pull-range-post",
gst_tracing_register_hook (tracer, "pad-pull-range-post",
G_CALLBACK (do_pull_range_post));
gst_tracer_register_hook (tracer, "pad-push-event-pre",
gst_tracing_register_hook (tracer, "pad-push-event-pre",
G_CALLBACK (do_push_event_pre));
gst_tracer_register_hook (tracer, "element-post-message-pre",
gst_tracing_register_hook (tracer, "element-post-message-pre",
G_CALLBACK (do_post_message_pre));
gst_tracer_register_hook (tracer, "element-query-pre",
gst_tracing_register_hook (tracer, "element-query-pre",
G_CALLBACK (do_query_pre));
}