[gtk/matthiasc/for-master: 4/8] application: Add some profiler marks



commit 73a214d1a9b9ed771bf482addf66bf18593fd884
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 22 21:28:51 2020 -0500

    application: Add some profiler marks
    
    Add marks around gtk_init and application startup
    helps to understand where the time before the first
    frame goes.

 gtk/gtkapplication.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index d614aa2a2c..82eea35e73 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -297,17 +297,25 @@ gtk_application_startup (GApplication *g_application)
 {
   GtkApplication *application = GTK_APPLICATION (g_application);
   GtkApplicationPrivate *priv = gtk_application_get_instance_private (application);
+  gint64 before = g_get_monotonic_time ();
+  gint64 before2;
 
   G_APPLICATION_CLASS (gtk_application_parent_class)->startup (g_application);
 
   gtk_action_muxer_insert (priv->muxer, "app", G_ACTION_GROUP (application));
 
+  before2 = g_get_monotonic_time ();
   gtk_init ();
+  if (gdk_profiler_is_running ())
+    gdk_profiler_add_mark (before2 * 1000, (g_get_monotonic_time () - before2) * 1000, "gtk init", NULL);
 
   priv->impl = gtk_application_impl_new (application, gdk_display_get_default ());
   gtk_application_impl_startup (priv->impl, priv->register_session);
 
   gtk_application_load_resources (application);
+
+  if (gdk_profiler_is_running ())
+    gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "gtk application 
startup", NULL);
 }
 
 static void


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