[gtk/tracing] Don't build profiler on win32



commit 7ba7cb6e0df07e58d8988c6d0edd8907b929e7b6
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon May 6 14:51:55 2019 -0700

    Don't build profiler on win32
    
    It doesn't currently work there.

 gdk/gdkprofiler.c | 121 +++++++++++++++++++++++++++++++++++++++---------------
 gdk/meson.build   |  11 +++--
 2 files changed, 97 insertions(+), 35 deletions(-)
---
diff --git a/gdk/gdkprofiler.c b/gdk/gdkprofiler.c
index eab63836cb..1a93badba9 100644
--- a/gdk/gdkprofiler.c
+++ b/gdk/gdkprofiler.c
@@ -24,11 +24,14 @@
 #include <unistd.h>
 
 #include "gdkversionmacros.h"
-#include "capture/sp-capture-writer.h"
 #include "gdkprofiler.h"
 #include "gdkprofilerprivate.h"
 #include "gdkframeclockprivate.h"
 
+#ifndef G_OS_WIN32
+
+#include "capture/sp-capture-writer.h"
+
 static SpCaptureWriter *writer = NULL;
 static gboolean running = FALSE;
 
@@ -92,37 +95,6 @@ gdk_profiler_add_mark (gint64      start,
                               "gtk", name, message);
 }
 
-/**
- * gdk_profiler_set_mark:
- * @duration: the duration of the mark, or 0
- * @name: the name of the mark (up to 40 characters)
- * @message: (optional): the message of the mark
- *
- * Insert a mark into the profiling data if we
- * are currently profiling.
- * This information will show up in tools like sysprof
- * or GNOME Builder when viewing the profiling data.
- * It can be used to mark interesting regions in the
- * captured data.
- *
- * If the duration is non-zero, the mark applies to
- * the timespan from @duration microseconds in the
- * past to the current time. To mark just a point in
- * time, pass 0 as duration.
- *
- * @name should be a short string, and @message is optional.
- */
-void
-gdk_profiler_set_mark (guint64     duration,
-                       const char *name,
-                       const char *message)
-{
-  guint64 start;
-
-  start = g_get_monotonic_time () - duration;
-  gdk_profiler_add_mark (start, duration, name, message);
-}
-
 static guint
 define_counter (const char *name,
                 const char *description,
@@ -197,3 +169,88 @@ gdk_profiler_set_int_counter (guint  id,
                                   -1, getpid (),
                                   &id, &value, 1);
 }
+
+#else
+
+void
+gdk_profiler_start (int fd)
+{
+}
+
+void
+gdk_profiler_stop (void)
+{
+}
+
+gboolean
+gdk_profiler_is_running (void)
+{
+  return FALSE;
+}
+
+void
+gdk_profiler_add_mark (gint64      start,
+                       guint64     duration,
+                       const char *name,
+                       const char *message)
+{
+}
+
+guint
+gdk_profiler_define_counter (const char *name,
+                             const char *description)
+{
+}
+
+void
+gdk_profiler_set_counter (guint  id,
+                          gint64 time,
+                          double value)
+{
+}
+
+guint
+gdk_profiler_define_int_counter (const char *name,
+                                 const char *description)
+{
+}
+
+void
+gdk_profiler_set_int_counter (guint  id,
+                              gint64 time,
+                              gint64 value)
+{
+}
+
+#endif /* G_OS_WIN32 */
+
+/**
+ * gdk_profiler_set_mark:
+ * @duration: the duration of the mark, or 0
+ * @name: the name of the mark (up to 40 characters)
+ * @message: (optional): the message of the mark
+ *
+ * Insert a mark into the profiling data if we
+ * are currently profiling.
+ * This information will show up in tools like sysprof
+ * or GNOME Builder when viewing the profiling data.
+ * It can be used to mark interesting regions in the
+ * captured data.
+ *
+ * If the duration is non-zero, the mark applies to
+ * the timespan from @duration microseconds in the
+ * past to the current time. To mark just a point in
+ * time, pass 0 as duration.
+ *
+ * @name should be a short string, and @message is optional.
+ */
+void
+gdk_profiler_set_mark (guint64     duration,
+                       const char *name,
+                       const char *message)
+{
+  guint64 start;
+
+  start = g_get_monotonic_time () - duration;
+  gdk_profiler_add_mark (start, duration, name, message);
+}
diff --git a/gdk/meson.build b/gdk/meson.build
index 5be5118121..3c411c1fb9 100644
--- a/gdk/meson.build
+++ b/gdk/meson.build
@@ -45,11 +45,16 @@ gdk_public_sources = files([
   'gdkvulkancontext.c',
   'gdksurface.c',
   'gdksurfaceimpl.c',
-  'gdkprofiler.c',
-  'capture/sp-capture-writer.c',
-  'capture/sp-clock.c'
+  'gdkprofiler.c'
 ])
 
+if not win32_enabled
+  gdk_public_sources += files([
+    'capture/sp-capture-writer.c',
+    'capture/sp-clock.c'
+  ])
+endif
+
 gdk_public_headers = files([
   'gdk-autocleanup.h',
   'gdk.h',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]