icontheme: Add profiler marks for loading icons
authorMatthias Clasen <mclasen@redhat.com>
Wed, 22 Jan 2020 19:49:17 +0000 (14:49 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 22 Jan 2020 20:12:03 +0000 (15:12 -0500)
This helps to clearly identify the places where we
do IO, in profiler traces.

gtk/gtkicontheme.c

index 5de6c07f394e88848c8f4d76fd14184ce051aa5e..25f010d6446dee71f1a41d8479977665d8a77a80 100644 (file)
@@ -50,6 +50,7 @@
 #include "gtkprivate.h"
 #include "gdkpixbufutilsprivate.h"
 #include "gdk/gdktextureprivate.h"
+#include "gdk/gdkprofilerprivate.h"
 
 /* this is in case round() is not provided by the compiler, 
  * such as in the case of C89 compilers, like MSVC
@@ -3243,6 +3244,8 @@ icon_info_ensure_scale_and_texture (GtkIconInfo *icon_info)
         icon_info->scale = (gdouble) scaled_desired_size / (icon_info->dir_size * dir_scale);
     }
 
+  gdk_profiler_add_mark (g_get_monotonic_time () * 1000, 0, "icon load", icon_info->filename);
+
   /* At this point, we need to actually get the icon; either from the
    * builtin image or by loading the file
    */