mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
frame clock: Redo the profiler marks
Instead of reporting the frame clock phases as defined, report the duration of the signal emissions, which is more useful for tracking down what is taking time.
This commit is contained in:
parent
3120fb29e1
commit
56b8d1dfbe
@ -649,43 +649,92 @@ gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
|
|||||||
void
|
void
|
||||||
_gdk_frame_clock_emit_flush_events (GdkFrameClock *frame_clock)
|
_gdk_frame_clock_emit_flush_events (GdkFrameClock *frame_clock)
|
||||||
{
|
{
|
||||||
|
guint64 before = g_get_monotonic_time ();
|
||||||
|
|
||||||
g_signal_emit (frame_clock, signals[FLUSH_EVENTS], 0);
|
g_signal_emit (frame_clock, signals[FLUSH_EVENTS], 0);
|
||||||
|
|
||||||
|
if (gdk_profiler_is_running ())
|
||||||
|
gdk_profiler_add_mark (before * 1000,
|
||||||
|
(g_get_monotonic_time () - before) * 1000,
|
||||||
|
"frameclock ::flush-events", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gdk_frame_clock_emit_before_paint (GdkFrameClock *frame_clock)
|
_gdk_frame_clock_emit_before_paint (GdkFrameClock *frame_clock)
|
||||||
{
|
{
|
||||||
|
guint64 before = g_get_monotonic_time ();
|
||||||
|
|
||||||
g_signal_emit (frame_clock, signals[BEFORE_PAINT], 0);
|
g_signal_emit (frame_clock, signals[BEFORE_PAINT], 0);
|
||||||
|
|
||||||
|
if (gdk_profiler_is_running ())
|
||||||
|
gdk_profiler_add_mark (before * 1000,
|
||||||
|
(g_get_monotonic_time () - before) * 1000,
|
||||||
|
"frameclock ::before-paint", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gdk_frame_clock_emit_update (GdkFrameClock *frame_clock)
|
_gdk_frame_clock_emit_update (GdkFrameClock *frame_clock)
|
||||||
{
|
{
|
||||||
|
guint64 before = g_get_monotonic_time ();
|
||||||
|
|
||||||
g_signal_emit (frame_clock, signals[UPDATE], 0);
|
g_signal_emit (frame_clock, signals[UPDATE], 0);
|
||||||
|
|
||||||
|
if (gdk_profiler_is_running ())
|
||||||
|
gdk_profiler_add_mark (before * 1000,
|
||||||
|
(g_get_monotonic_time () - before) * 1000,
|
||||||
|
"frameclock ::update", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock)
|
_gdk_frame_clock_emit_layout (GdkFrameClock *frame_clock)
|
||||||
{
|
{
|
||||||
|
guint64 before = g_get_monotonic_time ();
|
||||||
|
|
||||||
g_signal_emit (frame_clock, signals[LAYOUT], 0);
|
g_signal_emit (frame_clock, signals[LAYOUT], 0);
|
||||||
|
|
||||||
|
if (gdk_profiler_is_running ())
|
||||||
|
gdk_profiler_add_mark (before * 1000,
|
||||||
|
(g_get_monotonic_time () - before) * 1000,
|
||||||
|
"frameclock ::layout", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock)
|
_gdk_frame_clock_emit_paint (GdkFrameClock *frame_clock)
|
||||||
{
|
{
|
||||||
|
guint64 before = g_get_monotonic_time ();
|
||||||
|
|
||||||
g_signal_emit (frame_clock, signals[PAINT], 0);
|
g_signal_emit (frame_clock, signals[PAINT], 0);
|
||||||
|
|
||||||
|
if (gdk_profiler_is_running ())
|
||||||
|
gdk_profiler_add_mark (before * 1000,
|
||||||
|
(g_get_monotonic_time () - before) * 1000,
|
||||||
|
"frameclock ::paint", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock)
|
_gdk_frame_clock_emit_after_paint (GdkFrameClock *frame_clock)
|
||||||
{
|
{
|
||||||
|
guint64 before = g_get_monotonic_time ();
|
||||||
|
|
||||||
g_signal_emit (frame_clock, signals[AFTER_PAINT], 0);
|
g_signal_emit (frame_clock, signals[AFTER_PAINT], 0);
|
||||||
|
|
||||||
|
if (gdk_profiler_is_running ())
|
||||||
|
gdk_profiler_add_mark (before * 1000,
|
||||||
|
(g_get_monotonic_time () - before) * 1000,
|
||||||
|
"frameclock ::after-paint", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock)
|
_gdk_frame_clock_emit_resume_events (GdkFrameClock *frame_clock)
|
||||||
{
|
{
|
||||||
|
guint64 before = g_get_monotonic_time ();
|
||||||
|
|
||||||
g_signal_emit (frame_clock, signals[RESUME_EVENTS], 0);
|
g_signal_emit (frame_clock, signals[RESUME_EVENTS], 0);
|
||||||
|
|
||||||
|
if (gdk_profiler_is_running ())
|
||||||
|
gdk_profiler_add_mark (before * 1000,
|
||||||
|
(g_get_monotonic_time () - before) * 1000,
|
||||||
|
"frameclock ::resume-events", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef G_ENABLE_DEBUG
|
#ifdef G_ENABLE_DEBUG
|
||||||
@ -765,6 +814,7 @@ _gdk_frame_clock_add_timings_to_profiler (GdkFrameClock *clock,
|
|||||||
GdkFrameTimings *timings)
|
GdkFrameTimings *timings)
|
||||||
{
|
{
|
||||||
#ifdef G_ENABLE_DEBUG
|
#ifdef G_ENABLE_DEBUG
|
||||||
|
#if 0
|
||||||
gdk_profiler_add_mark (timings->frame_time * 1000,
|
gdk_profiler_add_mark (timings->frame_time * 1000,
|
||||||
(timings->frame_end_time - timings->frame_time) * 1000,
|
(timings->frame_end_time - timings->frame_time) * 1000,
|
||||||
"frame", "");
|
"frame", "");
|
||||||
@ -778,7 +828,7 @@ _gdk_frame_clock_add_timings_to_profiler (GdkFrameClock *clock,
|
|||||||
gdk_profiler_add_mark (timings->paint_start_time * 1000,
|
gdk_profiler_add_mark (timings->paint_start_time * 1000,
|
||||||
(timings->frame_end_time - timings->paint_start_time) * 1000,
|
(timings->frame_end_time - timings->paint_start_time) * 1000,
|
||||||
"paint", "");
|
"paint", "");
|
||||||
|
#endif
|
||||||
if (timings->presentation_time != 0)
|
if (timings->presentation_time != 0)
|
||||||
gdk_profiler_add_mark (timings->presentation_time * 1000,
|
gdk_profiler_add_mark (timings->presentation_time * 1000,
|
||||||
0,
|
0,
|
||||||
|
@ -408,14 +408,12 @@ gdk_frame_clock_paint_idle (void *data)
|
|||||||
if (priv->freeze_count == 0)
|
if (priv->freeze_count == 0)
|
||||||
{
|
{
|
||||||
int iter;
|
int iter;
|
||||||
#ifdef G_ENABLE_DEBUG
|
|
||||||
if (GDK_DEBUG_CHECK (FRAMES) || gdk_profiler_is_running ())
|
if (GDK_DEBUG_CHECK (FRAMES) || gdk_profiler_is_running ())
|
||||||
{
|
{
|
||||||
if (priv->phase != GDK_FRAME_CLOCK_PHASE_LAYOUT &&
|
if (priv->phase != GDK_FRAME_CLOCK_PHASE_LAYOUT &&
|
||||||
(priv->requested & GDK_FRAME_CLOCK_PHASE_LAYOUT))
|
(priv->requested & GDK_FRAME_CLOCK_PHASE_LAYOUT))
|
||||||
timings->layout_start_time = g_get_monotonic_time ();
|
timings->layout_start_time = g_get_monotonic_time ();
|
||||||
}
|
}
|
||||||
#endif /* G_ENABLE_DEBUG */
|
|
||||||
|
|
||||||
priv->phase = GDK_FRAME_CLOCK_PHASE_LAYOUT;
|
priv->phase = GDK_FRAME_CLOCK_PHASE_LAYOUT;
|
||||||
/* We loop in the layout phase, because we don't want to progress
|
/* We loop in the layout phase, because we don't want to progress
|
||||||
@ -438,14 +436,12 @@ gdk_frame_clock_paint_idle (void *data)
|
|||||||
case GDK_FRAME_CLOCK_PHASE_PAINT:
|
case GDK_FRAME_CLOCK_PHASE_PAINT:
|
||||||
if (priv->freeze_count == 0)
|
if (priv->freeze_count == 0)
|
||||||
{
|
{
|
||||||
#ifdef G_ENABLE_DEBUG
|
|
||||||
if (GDK_DEBUG_CHECK (FRAMES) || gdk_profiler_is_running ())
|
if (GDK_DEBUG_CHECK (FRAMES) || gdk_profiler_is_running ())
|
||||||
{
|
{
|
||||||
if (priv->phase != GDK_FRAME_CLOCK_PHASE_PAINT &&
|
if (priv->phase != GDK_FRAME_CLOCK_PHASE_PAINT &&
|
||||||
(priv->requested & GDK_FRAME_CLOCK_PHASE_PAINT))
|
(priv->requested & GDK_FRAME_CLOCK_PHASE_PAINT))
|
||||||
timings->paint_start_time = g_get_monotonic_time ();
|
timings->paint_start_time = g_get_monotonic_time ();
|
||||||
}
|
}
|
||||||
#endif /* G_ENABLE_DEBUG */
|
|
||||||
|
|
||||||
priv->phase = GDK_FRAME_CLOCK_PHASE_PAINT;
|
priv->phase = GDK_FRAME_CLOCK_PHASE_PAINT;
|
||||||
if (priv->requested & GDK_FRAME_CLOCK_PHASE_PAINT)
|
if (priv->requested & GDK_FRAME_CLOCK_PHASE_PAINT)
|
||||||
@ -602,7 +598,7 @@ gdk_frame_clock_idle_thaw (GdkFrameClock *clock)
|
|||||||
gint64 thaw_time = g_get_monotonic_time ();
|
gint64 thaw_time = g_get_monotonic_time ();
|
||||||
gdk_profiler_add_mark (priv->freeze_time * 1000,
|
gdk_profiler_add_mark (priv->freeze_time * 1000,
|
||||||
(thaw_time - priv->freeze_time) * 1000,
|
(thaw_time - priv->freeze_time) * 1000,
|
||||||
"freeze", "");
|
"frameclock freeze", "");
|
||||||
priv->freeze_time = 0;
|
priv->freeze_time = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user