clutter: add tracing for frameclock cycle

This adds a new frameclock tracing mark for a single cycle of the frame
clock. Doing so allows Sysprof to potentially do more with the information
that happens during the frameclock. For example, we can now find
allocations that happen while the frame clock is advancing.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1088
This commit is contained in:
Christian Hergert 2020-02-24 16:10:49 -08:00 committed by Georges Basile Stavracas Neto
parent 71101cab82
commit b7f47ea17f

View File

@ -29,6 +29,8 @@
* of #ClutterMasterClock.
*/
#include <cogl/cogl-trace.h>
#include "clutter-build-config.h"
#include "clutter-master-clock.h"
@ -461,6 +463,8 @@ clutter_clock_dispatch (GSource *source,
_clutter_threads_acquire_lock ();
COGL_TRACE_BEGIN (ClutterMasterClockTick, "Master Clock (tick)");
/* Get the time to use for this frame */
master_clock->cur_tick = g_source_get_time (source);
@ -492,6 +496,8 @@ clutter_clock_dispatch (GSource *source,
g_slist_free_full (stages, g_object_unref);
COGL_TRACE_END (ClutterMasterClockTick);
_clutter_threads_release_lock ();
return TRUE;