diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-12-25 00:16:29 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-12-25 09:44:41 -0500 |
commit | 0f538480c01e8df94047614e2092236daf99d498 (patch) | |
tree | 785b96d64f256412bfe56c25bb361935fc9e7b4b | |
parent | c9695879af169f3afd53f6a348fae564f5100b02 (diff) | |
download | pango-0f538480c01e8df94047614e2092236daf99d498.tar.gz |
tracing: Fix the defines
We want to define pango_trace_mark to nothing.
This reveals that we've never compiled these
calls out before, and there are some warnings
to be fixed in that case.
-rw-r--r-- | pango/pango-trace-private.h | 4 | ||||
-rw-r--r-- | pango/pangofc-fontmap.c | 28 |
2 files changed, 24 insertions, 8 deletions
diff --git a/pango/pango-trace-private.h b/pango/pango-trace-private.h index 5d2a4fdf..a782d45e 100644 --- a/pango/pango-trace-private.h +++ b/pango/pango-trace-private.h @@ -42,9 +42,9 @@ void pango_trace_mark (gint64 begin_time, #ifndef HAVE_SYSPROF /* Optimise the whole call out */ #if defined(G_HAVE_ISO_VARARGS) -#define g_trace_mark(b, n, m, ...) +#define pango_trace_mark(b, n, m, ...) #elif defined(G_HAVE_GNUC_VARARGS) -#define g_trace_mark(b, n, m...) +#define pango_trace_mark(b, n, m...) #else /* no varargs macro support; the call will have to be optimised out by the compiler */ #endif diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c index d198df45..10979413 100644 --- a/pango/pangofc-fontmap.c +++ b/pango/pangofc-fontmap.c @@ -835,7 +835,9 @@ match_in_thread (gpointer task_data) ThreadData *td = task_data; FcResult result; FcPattern *match; - gint64 before = PANGO_TRACE_CURRENT_TIME; + gint64 before G_GNUC_UNUSED; + + before = PANGO_TRACE_CURRENT_TIME; match = FcFontSetMatch (td->config, &td->fonts, 1, @@ -860,7 +862,9 @@ sort_in_thread (gpointer task_data) ThreadData *td = task_data; FcResult result; FcFontSet *fontset; - gint64 before = PANGO_TRACE_CURRENT_TIME; + gint64 before G_GNUC_UNUSED; + + before = PANGO_TRACE_CURRENT_TIME; fontset = FcFontSetSort (td->config, &td->fonts, 1, @@ -1023,9 +1027,11 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep if (i == 0) { - gint64 before = PANGO_TRACE_CURRENT_TIME; + gint64 before G_GNUC_UNUSED; gboolean waited = FALSE; + before = PANGO_TRACE_CURRENT_TIME; + g_mutex_lock (&pats->mutex); while (!pats->match && !pats->fontset) @@ -1039,8 +1045,10 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep g_mutex_unlock (&pats->mutex); +#ifdef HAVE_SYSPROF if (waited) pango_trace_mark (before, "wait for FcFontMatch", NULL); +#endif if (match) { @@ -1050,9 +1058,11 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep } else { - gint64 before = PANGO_TRACE_CURRENT_TIME; + gint64 before G_GNUC_UNUSED; gboolean waited = FALSE; + before = PANGO_TRACE_CURRENT_TIME; + g_mutex_lock (&pats->mutex); while (!pats->fontset) @@ -1065,8 +1075,10 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep g_mutex_unlock (&pats->mutex); +#ifdef HAVE_SYSPROF if (waited) pango_trace_mark (before, "wait for FcFontSort", NULL); +#endif } if (fontset) @@ -1354,7 +1366,9 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (PangoFcFontMap, pango_fc_font_map, PANGO_TYPE_ static gpointer init_in_thread (gpointer task_data) { - gint64 before = PANGO_TRACE_CURRENT_TIME; + gint64 before G_GNUC_UNUSED; + + before = PANGO_TRACE_CURRENT_TIME; FcInit (); @@ -1388,9 +1402,11 @@ start_init_in_thread (PangoFcFontMap *fcfontmap) static void wait_for_fc_init (void) { - gint64 before = PANGO_TRACE_CURRENT_TIME; + gint64 before G_GNUC_UNUSED; gboolean waited = FALSE; + before = PANGO_TRACE_CURRENT_TIME; + g_mutex_lock (&fc_init_mutex); while (fc_initialized < DEFAULT_CONFIG_INITIALIZED) { |