From b413f45beedace83c7009a4a76ead9eacf765497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 11 May 2023 00:11:29 +0200 Subject: [PATCH] profiler: Enable tracing on threads added while running Part-of: --- src/core/meta-profiler.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/meta-profiler.c b/src/core/meta-profiler.c index 8f225f2b7..ae703e9b5 100644 --- a/src/core/meta-profiler.c +++ b/src/core/meta-profiler.c @@ -323,6 +323,8 @@ meta_profiler_register_thread (MetaProfiler *profiler, g_warn_if_fail (!g_list_find (profiler->threads, main_context)); profiler->threads = g_list_prepend (profiler->threads, thread_info_new (main_context, name)); + if (profiler->running) + cogl_set_tracing_enabled_on_thread (main_context, name); g_mutex_unlock (&profiler->mutex); } @@ -343,5 +345,9 @@ meta_profiler_unregister_thread (MetaProfiler *profiler, break; } } + + if (profiler->running) + cogl_set_tracing_disabled_on_thread (main_context); + g_mutex_unlock (&profiler->mutex); }