diff --git a/public/client/TracyCallstack.cpp b/public/client/TracyCallstack.cpp index 0108deac..6560de33 100644 --- a/public/client/TracyCallstack.cpp +++ b/public/client/TracyCallstack.cpp @@ -138,9 +138,13 @@ KernelDriver* s_krnlCache = nullptr; size_t s_krnlCacheCnt; -void InitCallstack() +void InitCallstackCritical() { ___tracy_RtlWalkFrameChain = (___tracy_t_RtlWalkFrameChain)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "RtlWalkFrameChain" ); +} + +void InitCallstack() +{ _SymAddrIncludeInlineTrace = (t_SymAddrIncludeInlineTrace)GetProcAddress( GetModuleHandleA( "dbghelp.dll" ), "SymAddrIncludeInlineTrace" ); _SymQueryInlineTrace = (t_SymQueryInlineTrace)GetProcAddress( GetModuleHandleA( "dbghelp.dll" ), "SymQueryInlineTrace" ); _SymFromInlineContext = (t_SymFromInlineContext)GetProcAddress( GetModuleHandleA( "dbghelp.dll" ), "SymFromInlineContext" ); @@ -695,6 +699,10 @@ static void InitKernelSymbols() } #endif +void InitCallstackCritical() +{ +} + void InitCallstack() { cb_bts = backtrace_create_state( nullptr, 0, nullptr, nullptr ); @@ -1028,6 +1036,10 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr ) #elif TRACY_HAS_CALLSTACK == 5 +void InitCallstackCritical() +{ +} + void InitCallstack() { ___tracy_init_demangle_buffer(); diff --git a/public/client/TracyCallstack.hpp b/public/client/TracyCallstack.hpp index 117d8044..bc50561c 100644 --- a/public/client/TracyCallstack.hpp +++ b/public/client/TracyCallstack.hpp @@ -55,6 +55,7 @@ CallstackSymbolData DecodeCodeAddress( uint64_t ptr ); const char* DecodeCallstackPtrFast( uint64_t ptr ); CallstackEntryData DecodeCallstackPtr( uint64_t ptr ); void InitCallstack(); +void InitCallstackCritical(); void EndCallstack(); const char* GetKernelModulePath( uint64_t addr ); diff --git a/public/client/TracyProfiler.cpp b/public/client/TracyProfiler.cpp index 658f0b39..f48f96e2 100644 --- a/public/client/TracyProfiler.cpp +++ b/public/client/TracyProfiler.cpp @@ -1444,7 +1444,7 @@ void Profiler::SpawnWorkerThreads() #endif #ifdef TRACY_HAS_CALLSTACK - InitCallstack(); + InitCallstackCritical(); #endif m_timeBegin.store( GetTime(), std::memory_order_relaxed ); @@ -3296,11 +3296,11 @@ void Profiler::SymbolWorker() { ThreadExitHandler threadExitHandler; SetThreadName( "Tracy Symbol Worker" ); - while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) ); - #ifdef TRACY_USE_RPMALLOC rpmalloc_thread_initialize(); #endif + InitCallstack(); + while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) ); for(;;) {