From 55ce01c69ecda1939ddc7d59eb17eb0b496da925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Gr=C3=A9goire?= Date: Sun, 1 Feb 2026 12:35:46 +0100 Subject: [PATCH] Reenable TracyDebug LogString except under TRACY_DELAYED_INIT and not TRACY_MANUAL_LIFETIME --- public/client/TracyDebug.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/client/TracyDebug.hpp b/public/client/TracyDebug.hpp index 258c7572..419ac69e 100644 --- a/public/client/TracyDebug.hpp +++ b/public/client/TracyDebug.hpp @@ -18,6 +18,12 @@ #ifdef TRACY_VERBOSE # include # define TracyDebug(...) do { fprintf( stderr, __VA_ARGS__ ); fputc( '\n', stderr ); } while( 0 ) +// Note: We can't use LogString when using TRACY_DELAYED_INIT due to a deadlock in the init code. +// This is caused by `GetProfilerData` triggerting ProfileData ctor, which itself will call `GetProfilerData` and deadlock. +// TRACY_MANUAL_LIFETIME does not have this issue since StartupProfiler sets s_profilerData before calling the constructor. +// In general, this also means we can only call TracyDebug after and the first logging is after queue initialization and critical init (such as InitCallstackCritical). +#elif !defined(TRACY_NO_INTERNAL_MESSAGE) && (!defined(TRACY_DELAYED_INIT) || defined(TRACY_MANUAL_LIFETIME)) +# define TracyDebug(...) TracyInternalMessage( tracy::MessageSeverity::Debug, __VA_ARGS__ ) #else # define TracyDebug(...) #endif