mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
tracers: Add tracepoint when a plugin feature it loaded
This makes it possible to trace which ones are loaded in a specific program to make nice statistics. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/782>
This commit is contained in:
parent
2b01467934
commit
8332b44a2a
3 changed files with 32 additions and 1 deletions
|
@ -124,6 +124,8 @@ gst_plugin_feature_load (GstPluginFeature * feature)
|
|||
else if (!real_feature->loaded)
|
||||
goto not_found;
|
||||
|
||||
GST_TRACER_PLUGIN_FEATURE_LOADED (real_feature);
|
||||
|
||||
return real_feature;
|
||||
|
||||
/* ERRORS */
|
||||
|
|
|
@ -54,7 +54,7 @@ static const gchar *_quark_strings[] = {
|
|||
"element-change-state-pre", "element-change-state-post",
|
||||
"mini-object-created", "mini-object-destroyed", "object-created",
|
||||
"object-destroyed", "mini-object-reffed", "mini-object-unreffed",
|
||||
"object-reffed", "object-unreffed",
|
||||
"object-reffed", "object-unreffed", "plugin-feature-loaded"
|
||||
};
|
||||
|
||||
GQuark _priv_gst_tracer_quark_table[GST_TRACER_QUARK_MAX];
|
||||
|
|
|
@ -79,6 +79,7 @@ typedef enum /*< skip >*/
|
|||
GST_TRACER_QUARK_HOOK_MINI_OBJECT_UNREFFED,
|
||||
GST_TRACER_QUARK_HOOK_OBJECT_REFFED,
|
||||
GST_TRACER_QUARK_HOOK_OBJECT_UNREFFED,
|
||||
GST_TRACER_QUARK_HOOK_PLUGIN_FEATURE_LOADED,
|
||||
GST_TRACER_QUARK_MAX
|
||||
} GstTracerQuarkId;
|
||||
|
||||
|
@ -689,11 +690,38 @@ typedef void (*GstTracerHookObjectCreated) (GObject *self, GstClockTime ts,
|
|||
*/
|
||||
typedef void (*GstTracerHookObjectDestroyed) (GObject *self, GstClockTime ts,
|
||||
GstObject *object);
|
||||
|
||||
#define GST_TRACER_OBJECT_DESTROYED(object) G_STMT_START{ \
|
||||
GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_OBJECT_DESTROYED), \
|
||||
GstTracerHookObjectDestroyed, (GST_TRACER_ARGS, object)); \
|
||||
}G_STMT_END
|
||||
|
||||
/**
|
||||
* GstTracerHookPluginFeatureLoaded:
|
||||
* @self: the tracer instance
|
||||
* @ts: the current timestamp
|
||||
* @feature: the plugin feature that was loaded
|
||||
*
|
||||
* Hook called when a GstPluginFeature is loaded named
|
||||
* "plugin-feature-loaded".
|
||||
*
|
||||
* Since: 1.20
|
||||
*/
|
||||
typedef void (*GstTracerHookPluginFeatureLoaded) (GObject *self, GstClockTime ts,
|
||||
GstPluginFeature *feature);
|
||||
/**
|
||||
* GST_TRACER_PLUGIN_FEATURE_LOADED:
|
||||
* @feature: The feature that this tracer is called for
|
||||
*
|
||||
* Add a tracepoint when a plugin feature is loaded.
|
||||
*
|
||||
* Since: 1.20
|
||||
*/
|
||||
#define GST_TRACER_PLUGIN_FEATURE_LOADED(feature) G_STMT_START{ \
|
||||
GST_TRACER_DISPATCH(GST_TRACER_QUARK(HOOK_PLUGIN_FEATURE_LOADED), \
|
||||
GstTracerHookPluginFeatureLoaded, (GST_TRACER_ARGS, feature)); \
|
||||
}G_STMT_END
|
||||
|
||||
|
||||
#else /* !GST_DISABLE_GST_TRACER_HOOKS */
|
||||
|
||||
|
@ -743,6 +771,7 @@ _priv_gst_tracing_deinit (void)
|
|||
#define GST_TRACER_OBJECT_DESTROYED(object)
|
||||
#define GST_TRACER_OBJECT_REFFED(object, new_refcount)
|
||||
#define GST_TRACER_OBJECT_UNREFFED(object, new_refcount)
|
||||
#define GST_TRACER_PLUGIN_FEATURE_LOADED(feature)
|
||||
|
||||
#endif /* GST_DISABLE_GST_TRACER_HOOKS */
|
||||
|
||||
|
|
Loading…
Reference in a new issue