mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
leaks: Do not trace refs for object we do not follow
When the user sets filters, we should not trace ref counts of object that are not traced. This optimizes the tracer by potentially avoiding generating useless backtraces.
This commit is contained in:
parent
d28e0b4147
commit
14cd8b8348
1 changed files with 13 additions and 6 deletions
|
@ -413,8 +413,8 @@ object_created_cb (GstTracer * tracer, GstClockTime ts, GstObject * object)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_object_reffed (GstLeaksTracer * self, gpointer object, gint new_refcount,
|
handle_object_reffed (GstLeaksTracer * self, gpointer object, GType type,
|
||||||
gboolean reffed, GstClockTime ts)
|
gint new_refcount, gboolean reffed, GstClockTime ts)
|
||||||
{
|
{
|
||||||
ObjectRefingInfos *infos;
|
ObjectRefingInfos *infos;
|
||||||
ObjectRefingInfo *refinfo;
|
ObjectRefingInfo *refinfo;
|
||||||
|
@ -422,6 +422,9 @@ handle_object_reffed (GstLeaksTracer * self, gpointer object, gint new_refcount,
|
||||||
if (!self->check_refs)
|
if (!self->check_refs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!should_handle_object_type (self, type))
|
||||||
|
return;
|
||||||
|
|
||||||
GST_OBJECT_LOCK (self);
|
GST_OBJECT_LOCK (self);
|
||||||
infos = g_hash_table_lookup (self->objects, object);
|
infos = g_hash_table_lookup (self->objects, object);
|
||||||
if (!infos)
|
if (!infos)
|
||||||
|
@ -446,7 +449,8 @@ object_reffed_cb (GstTracer * tracer, GstClockTime ts, GstObject * object,
|
||||||
{
|
{
|
||||||
GstLeaksTracer *self = GST_LEAKS_TRACER_CAST (tracer);
|
GstLeaksTracer *self = GST_LEAKS_TRACER_CAST (tracer);
|
||||||
|
|
||||||
handle_object_reffed (self, object, new_refcount, TRUE, ts);
|
handle_object_reffed (self, object, G_OBJECT_TYPE (object), new_refcount,
|
||||||
|
TRUE, ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -455,7 +459,8 @@ object_unreffed_cb (GstTracer * tracer, GstClockTime ts, GstObject * object,
|
||||||
{
|
{
|
||||||
GstLeaksTracer *self = GST_LEAKS_TRACER_CAST (tracer);
|
GstLeaksTracer *self = GST_LEAKS_TRACER_CAST (tracer);
|
||||||
|
|
||||||
handle_object_reffed (self, object, new_refcount, FALSE, ts);
|
handle_object_reffed (self, object, G_OBJECT_TYPE (object), new_refcount,
|
||||||
|
FALSE, ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -464,7 +469,8 @@ mini_object_reffed_cb (GstTracer * tracer, GstClockTime ts,
|
||||||
{
|
{
|
||||||
GstLeaksTracer *self = GST_LEAKS_TRACER_CAST (tracer);
|
GstLeaksTracer *self = GST_LEAKS_TRACER_CAST (tracer);
|
||||||
|
|
||||||
handle_object_reffed (self, object, new_refcount, TRUE, ts);
|
handle_object_reffed (self, object, GST_MINI_OBJECT_TYPE (object),
|
||||||
|
new_refcount, TRUE, ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -473,7 +479,8 @@ mini_object_unreffed_cb (GstTracer * tracer, GstClockTime ts,
|
||||||
{
|
{
|
||||||
GstLeaksTracer *self = GST_LEAKS_TRACER_CAST (tracer);
|
GstLeaksTracer *self = GST_LEAKS_TRACER_CAST (tracer);
|
||||||
|
|
||||||
handle_object_reffed (self, object, new_refcount, FALSE, ts);
|
handle_object_reffed (self, object, GST_MINI_OBJECT_TYPE (object),
|
||||||
|
new_refcount, FALSE, ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue