From bed42454d3b737ba0d0658a790c12b19e3f27e82 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Thu, 23 Nov 2023 08:14:42 +0400 Subject: [PATCH] cogl/trace: Make COGL_TRACE_DESCRIBE append Sometimes it's useful to combine the description from multiple places. For example, a subsequent commit will add the output name as the first thing to the frame clock span descriptions, leaving the rest of the description with complex checks unchanged. Part-of: --- cogl/cogl/cogl-trace.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cogl/cogl/cogl-trace.c b/cogl/cogl/cogl-trace.c index f0dbe98c6..cc724c984 100644 --- a/cogl/cogl/cogl-trace.c +++ b/cogl/cogl/cogl-trace.c @@ -342,7 +342,15 @@ void cogl_trace_describe (CoglTraceHead *head, const char *description) { - head->description = g_strdup (description); + if (head->description) + { + char *old_description = head->description; + head->description = + g_strdup_printf ("%s, %s", old_description, description); + g_free (old_description); + } + else + head->description = g_strdup (description); } #else