From 6b1f49c153426731f60c2fef207e7a4ea9995d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 3 Feb 2021 00:05:41 +0100 Subject: [PATCH] clutter/actor: Optionally trace allocations If 'detailed-trace' is enabled, trace the allocation of every actor every frame, and pass along the type and name of the actor to sysprof. Part-of: --- clutter/clutter/clutter-actor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index b471589a6..a8e5da59e 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -9203,6 +9203,16 @@ clutter_actor_allocate (ClutterActor *self, !clutter_actor_has_mapped_clones (self)) return; + COGL_TRACE_SCOPED_ANCHOR (ClutterActorAllocate); + + if (G_UNLIKELY (clutter_debug_flags & CLUTTER_DEBUG_DETAILED_TRACE)) + { + COGL_TRACE_BEGIN_ANCHORED (ClutterActorAllocate, + "ClutterActor (allocate)"); + COGL_TRACE_DESCRIBE (ClutterActorAllocate, + _clutter_actor_get_debug_name (self)); + } + old_allocation = priv->allocation; real_allocation = *box;