cogl/trace: Fix argument naming

The argument passed to COGL_TRACE() and friends is the "name", not the
optional "description". Clean this up so we can add description handling
too.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1700>
This commit is contained in:
Jonas Ådahl 2021-02-02 23:28:01 +01:00
parent 96b1ebb2fd
commit dd40e35ab2

View File

@ -83,22 +83,22 @@ cogl_auto_trace_end_helper (CoglTraceHead **head)
cogl_trace_end (*head); cogl_trace_end (*head);
} }
#define COGL_TRACE_BEGIN(Name, description) \ #define COGL_TRACE_BEGIN(Name, name) \
CoglTraceHead CoglTrace##Name = { 0 }; \ CoglTraceHead CoglTrace##Name = { 0 }; \
if (g_private_get (&cogl_trace_thread_data)) \ if (g_private_get (&cogl_trace_thread_data)) \
cogl_trace_begin (&CoglTrace##Name, description); \ cogl_trace_begin (&CoglTrace##Name, name); \
#define COGL_TRACE_END(Name)\ #define COGL_TRACE_END(Name)\
if (g_private_get (&cogl_trace_thread_data)) \ if (g_private_get (&cogl_trace_thread_data)) \
cogl_trace_end (&CoglTrace##Name); cogl_trace_end (&CoglTrace##Name);
#define COGL_TRACE_BEGIN_SCOPED(Name, description) \ #define COGL_TRACE_BEGIN_SCOPED(Name, name) \
CoglTraceHead CoglTrace##Name = { 0 }; \ CoglTraceHead CoglTrace##Name = { 0 }; \
__attribute__((cleanup (cogl_auto_trace_end_helper))) \ __attribute__((cleanup (cogl_auto_trace_end_helper))) \
CoglTraceHead *ScopedCoglTrace##Name = NULL; \ CoglTraceHead *ScopedCoglTrace##Name = NULL; \
if (g_private_get (&cogl_trace_thread_data)) \ if (g_private_get (&cogl_trace_thread_data)) \
{ \ { \
cogl_trace_begin (&CoglTrace##Name, description); \ cogl_trace_begin (&CoglTrace##Name, name); \
ScopedCoglTrace##Name = &CoglTrace##Name; \ ScopedCoglTrace##Name = &CoglTrace##Name; \
} }
@ -106,9 +106,9 @@ cogl_auto_trace_end_helper (CoglTraceHead **head)
#include <stdio.h> #include <stdio.h>
#define COGL_TRACE_BEGIN(Name, description) (void) 0 #define COGL_TRACE_BEGIN(Name, name) (void) 0
#define COGL_TRACE_END(Name) (void) 0 #define COGL_TRACE_END(Name) (void) 0
#define COGL_TRACE_BEGIN_SCOPED(Name, description) (void) 0 #define COGL_TRACE_BEGIN_SCOPED(Name, name) (void) 0
COGL_EXPORT void COGL_EXPORT void
cogl_set_tracing_enabled_on_thread_with_fd (void *data, cogl_set_tracing_enabled_on_thread_with_fd (void *data,