mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 08:11:16 +00:00
gstleaks: log the number of alive objects
Can help checking if the number of alive objects is growing over time or stays stable. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2245>
This commit is contained in:
parent
e207ff905b
commit
8eccf79fff
1 changed files with 5 additions and 2 deletions
|
@ -697,6 +697,7 @@ process_leaks (GstLeaksTracer * self, GValue * ret_leaks)
|
||||||
{
|
{
|
||||||
GList *leaks, *l;
|
GList *leaks, *l;
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
|
guint n = 0;
|
||||||
|
|
||||||
if (!ret_leaks)
|
if (!ret_leaks)
|
||||||
GST_TRACE_OBJECT (self, "start listing currently alive objects");
|
GST_TRACE_OBJECT (self, "start listing currently alive objects");
|
||||||
|
@ -708,8 +709,10 @@ process_leaks (GstLeaksTracer * self, GValue * ret_leaks)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (l = leaks; l; l = l->next)
|
for (l = leaks; l; l = l->next) {
|
||||||
process_leak (l->data, ret_leaks);
|
process_leak (l->data, ret_leaks);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
|
||||||
g_list_free_full (leaks, (GDestroyNotify) leak_free);
|
g_list_free_full (leaks, (GDestroyNotify) leak_free);
|
||||||
|
|
||||||
|
@ -717,7 +720,7 @@ process_leaks (GstLeaksTracer * self, GValue * ret_leaks)
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (!ret_leaks)
|
if (!ret_leaks)
|
||||||
GST_TRACE_OBJECT (self, "done listing currently alive objects");
|
GST_TRACE_OBJECT (self, "listed %u alive objects", n);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue