1
0
Fork 0

cogl/trace: Fix build without profiler

When !3952 introduced the new tracing macros, they were only defined in
the HAVE_PROFILER case, causing builds without profiler support to fail.

Also it introduced an unconditional call to cogl_is_tracing_enabled()
which is not available without HAVE_PROFILER.

Fixes: 777c63507 ("cogl/trace: Allow defining and setting sysprof trace counters")
Fixes: 322ac42a6 ("stage-impl: Trace the damage region")
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3991>
This commit is contained in:
Sebastian Keller 2024-08-31 18:43:40 +02:00
parent 7c7e147fd2
commit 2eddf35625
2 changed files with 6 additions and 0 deletions

View file

@ -240,6 +240,10 @@ cogl_trace_counter_data_double (gpointer user_data)
#define COGL_TRACE_SCOPED_ANCHOR(Name) (void) 0
#define COGL_TRACE_BEGIN_ANCHORED(Name, name) (void) 0
#define COGL_TRACE_MESSAGE(name, ...) (void) 0
#define COGL_TRACE_DEFINE_COUNTER_INT(Name, name, description) (void) 0
#define COGL_TRACE_DEFINE_COUNTER_DOUBLE(Name, name, description) (void) 0
#define COGL_TRACE_SET_COUNTER_INT(Name, value) (void) 0
#define COGL_TRACE_SET_COUNTER_DOUBLE(Name, value) (void) 0
COGL_EXPORT
gboolean cogl_start_tracing_with_path (const char *filename,

View file

@ -682,6 +682,7 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
paint_stage (stage_impl, stage_view, redraw_clip, frame);
}
#ifdef HAVE_PROFILER
if (G_UNLIKELY (cogl_is_tracing_enabled ()))
{
g_autoptr (GString) rects_str = NULL;
@ -708,6 +709,7 @@ meta_stage_impl_redraw_view_primary (MetaStageImpl *stage_impl,
COGL_TRACE_DESCRIBE (RedrawViewPrimary, rects_str->str);
COGL_TRACE_SET_COUNTER_INT (RedrawViewPrimaryDamageArea, area);
}
#endif
g_clear_pointer (&redraw_clip, mtk_region_unref);
g_clear_pointer (&fb_clip_region, mtk_region_unref);