summaryrefslogtreecommitdiff
path: root/gdk/gdkprofilerprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdk/gdkprofilerprivate.h')
-rw-r--r--gdk/gdkprofilerprivate.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdk/gdkprofilerprivate.h b/gdk/gdkprofilerprivate.h
index 99558e3adf..1c68739e0e 100644
--- a/gdk/gdkprofilerprivate.h
+++ b/gdk/gdkprofilerprivate.h
@@ -23,6 +23,21 @@
G_BEGIN_DECLS
+/* Ensure we included config.h as needed for the below HAVE_SYSPROF_CAPTURE check */
+#ifndef GETTEXT_PACKAGE
+#error "config.h was not included before gdkprofilerprivate.h."
+#endif
+
+/* We make this a macro you use as if (GDK_PROFILER_IS_RUNNING) because that
+ * way we can ensure all the code is compiled out when not supported, and
+ * we can add a G_UNLIKELY() for better codegen if it is.
+ */
+#ifdef HAVE_SYSPROF_CAPTURE
+#define GDK_PROFILER_IS_RUNNING G_UNLIKELY (gdk_profiler_is_running ())
+#else
+#define GDK_PROFILER_IS_RUNNING FALSE
+#endif
+
void gdk_profiler_start (int fd);
void gdk_profiler_stop (void);
gboolean gdk_profiler_is_running (void);