summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Ã…dahl <jadahl@gmail.com>2020-11-30 12:07:16 +0100
committerMarge Bot <marge-bot@gnome.org>2020-12-01 11:41:11 +0000
commit7eb20b2c3979eb5b37f42fecbf2c9732dacc99a7 (patch)
treea07d612d255fdbed306b5fbd931d3cca46d5249e /src
parent48a90e3a8623d0ae08067f56d3ee844a77352697 (diff)
downloadmutter-7eb20b2c3979eb5b37f42fecbf2c9732dacc99a7.tar.gz
window: Add some trace instrumentation to implement show/hide
Showing and hiding caused several second stalls, and still cause large enough stalls to cause missed frames, makes this visible to Sysprof. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1616>
Diffstat (limited to 'src')
-rw-r--r--src/core/window.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/window.c b/src/core/window.c
index 2c9a7fbb5..c43b83a25 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -1807,6 +1807,8 @@ idle_calc_showing (gpointer data)
GSList *displays;
guint queue_index = GPOINTER_TO_INT (data);
+ COGL_TRACE_BEGIN_SCOPED (MetaWindowCalcShowing, "Window: Calc showing");
+
g_return_val_if_fail (queue_pending[queue_index] != NULL, FALSE);
meta_topic (META_DEBUG_WINDOW_STATE,
@@ -1833,6 +1835,8 @@ idle_calc_showing (gpointer data)
unplaced = NULL;
displays = NULL;
+ COGL_TRACE_BEGIN (MetaWindowCalcShowingCalc, "Window: Calc showing (calc)");
+
tmp = copy;
while (tmp != NULL)
{
@@ -1857,6 +1861,11 @@ idle_calc_showing (gpointer data)
should_show = g_slist_sort (should_show, stackcmp);
should_show = g_slist_reverse (should_show);
+ COGL_TRACE_END (MetaWindowCalcShowingCalc);
+
+ COGL_TRACE_BEGIN (MetaWindowCalcShowingUnplaced,
+ "Window: Calc showing (calc unplaced)");
+
tmp = unplaced;
while (tmp != NULL)
{
@@ -1869,8 +1878,11 @@ idle_calc_showing (gpointer data)
tmp = tmp->next;
}
+ COGL_TRACE_END (MetaWindowCalcShowingUnplaced);
+
meta_stack_freeze (display->stack);
+ COGL_TRACE_BEGIN (MetaWindowCalcShowingShow, "Window: Calc showing (show)");
tmp = should_show;
while (tmp != NULL)
{
@@ -1882,7 +1894,9 @@ idle_calc_showing (gpointer data)
tmp = tmp->next;
}
+ COGL_TRACE_END (MetaWindowCalcShowingShow);
+ COGL_TRACE_BEGIN (MetaWindowCalcShowingHide, "Window: Calc showing (hide)");
tmp = should_hide;
while (tmp != NULL)
{
@@ -1894,8 +1908,12 @@ idle_calc_showing (gpointer data)
tmp = tmp->next;
}
+ COGL_TRACE_END (MetaWindowCalcShowingHide);
+ COGL_TRACE_BEGIN (MetaWindowCalcShowingSync,
+ "Window: Calc showing (sync stack)");
meta_stack_thaw (display->stack);
+ COGL_TRACE_END (MetaWindowCalcShowingSync);
tmp = copy;
while (tmp != NULL)