debugutils: Use SHOW_FULL_PARAMS when GstDotsTracer is active

When the dots tracer is detected among active tracers, switch from
SHOW_ALL to SHOW_FULL_PARAMS to prevent parameter ellipsization.
The dots tracer is designed to work with gst-dots-viewer which can
handle long parameter values, so we preserve the full text in dot files.

This improves the viewing experience when using the dots tracer with
the gst-dots-viewer tool.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9547>
This commit is contained in:
Thibault Saunier 2025-08-12 11:10:55 -04:00 committed by GStreamer Marge Bot
parent e87b3b0359
commit 3715b0b7b8
2 changed files with 34 additions and 2 deletions

View File

@ -120,6 +120,38 @@ debug_dump_get_object_params (GObject * object,
gchar *tmp, *value_str;
const gchar *ellipses;
if (details == GST_DEBUG_GRAPH_SHOW_ALL) {
static gsize dots_tracer_enabled = 0;
if (g_once_init_enter (&dots_tracer_enabled)) {
GList *tracers, *tmp;
gsize enabled = 1; /* 1 = not enabled, 2 = enabled */
tracers = gst_tracing_get_active_tracers ();
for (tmp = tracers; tmp; tmp = tmp->next) {
GObject *tracer = G_OBJECT (tmp->data);
const gchar *type_name = G_OBJECT_TYPE_NAME (tracer);
if (g_strcmp0 (type_name, "GstDotsTracer") == 0) {
enabled = 2;
break;
}
}
g_list_free_full (tracers, gst_object_unref);
g_once_init_leave (&dots_tracer_enabled, enabled);
}
/* If dots tracer is enabled, use SHOW_FULL_PARAMS instead of SHOW_ALL.
* The dots tracer is meant to be used with gst-dots-viewer which will
* ellipsize long lines for us, so we should always keep the full text
* in the dot files in that case. */
if (dots_tracer_enabled == 2) {
details = GST_DEBUG_GRAPH_SHOW_FULL_PARAMS;
}
}
/* get paramspecs and show non-default properties */
properties =
g_object_class_list_properties (G_OBJECT_GET_CLASS (object),

View File

@ -286,9 +286,9 @@ _priv_gst_tracing_init (void)
_priv_tracers = g_hash_table_new (NULL, NULL);
if (G_N_ELEMENTS (_quark_strings) + 1 != GST_TRACER_QUARK_MAX)
if (G_N_ELEMENTS (_quark_strings) != GST_TRACER_QUARK_MAX + 1)
g_warning ("the quark table is not consistent! %d != %d",
(gint) G_N_ELEMENTS (_quark_strings), GST_TRACER_QUARK_MAX);
(gint) G_N_ELEMENTS (_quark_strings), GST_TRACER_QUARK_MAX + 1);
for (i = 0; i <= GST_TRACER_QUARK_MAX; i++) {
_priv_gst_tracer_quark_table[i] =