From: Matthias Clasen Date: Tue, 4 Feb 2020 23:47:42 +0000 (+0100) Subject: emojichooser: Add profiler marks for loading X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~93 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=54f65150052d8ac1eb53a83ff89458c6c918d579;p=gtk4.git emojichooser: Add profiler marks for loading This is a long-running operation, and worth showing in traces. --- diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index 9865ce8aeb..f64ce36557 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -35,6 +35,7 @@ #include "gtksearchentryprivate.h" #include "gtkstylecontext.h" #include "gtktext.h" +#include "gdk/gdkprofilerprivate.h" #define BOX_SPACE 6 @@ -451,7 +452,11 @@ populate_emoji_chooser (gpointer data) now = g_get_monotonic_time (); if (now > start + 8000) - return G_SOURCE_CONTINUE; + { + if (gdk_profiler_is_running ()) + gdk_profiler_add_mark (start * 1000, (now - start) * 1000, "emojichooser", "populate"); + return G_SOURCE_CONTINUE; + } } g_variant_iter_free (chooser->iter); @@ -459,6 +464,12 @@ populate_emoji_chooser (gpointer data) chooser->box = NULL; chooser->populate_idle = 0; + if (gdk_profiler_is_running ()) + { + now = g_get_monotonic_time (); + gdk_profiler_add_mark (start * 1000, (now - start) * 1000, "emojichooser", "populate (finish)"); + } + return G_SOURCE_REMOVE; }