diff --git a/NEWS b/NEWS index f68937ce..f9ac3f86 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,14 @@ be able to talk with each other. Network protocol breakages won't be listed here. +v0.x.x (xxxx-xx-xx) +------------------- + +- Added TRACY_NO_CALLSTACK_INLINES macro to disable inline functions + resolution in call stacks on Windows. +- Limited client query response rate. + + v0.7.8 (2021-05-19) ------------------- diff --git a/client/TracyCallstack.cpp b/client/TracyCallstack.cpp index 4c87e6c7..28bbe763 100644 --- a/client/TracyCallstack.cpp +++ b/client/TracyCallstack.cpp @@ -292,7 +292,7 @@ CallstackSymbolData DecodeCodeAddress( uint64_t ptr ) #ifdef TRACY_DBGHELP_LOCK DBGHELP_LOCK; #endif -#ifndef __CYGWIN__ +#if !defined __CYGWIN__ && !defined TRACY_NO_CALLSTACK_INLINES DWORD inlineNum = SymAddrIncludeInlineTrace( proc, ptr ); DWORD ctx = 0; DWORD idx; @@ -335,7 +335,7 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr ) #ifdef TRACY_DBGHELP_LOCK DBGHELP_LOCK; #endif -#ifndef __CYGWIN__ +#if !defined __CYGWIN__ && !defined TRACY_NO_CALLSTACK_INLINES DWORD inlineNum = SymAddrIncludeInlineTrace( proc, ptr ); if( inlineNum > MaxCbTrace - 1 ) inlineNum = MaxCbTrace - 1; DWORD ctx = 0; @@ -393,7 +393,7 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr ) } } -#ifndef __CYGWIN__ +#if !defined __CYGWIN__ && !defined TRACY_NO_CALLSTACK_INLINES if( doInline ) { for( DWORD i=0; iHasData() ) { keepAlive++; std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) ); @@ -1687,10 +1687,12 @@ void Profiler::Worker() keepAlive = 0; } + int quota = 500; bool connActive = true; - while( m_sock->HasData() && connActive ) + while( quota-- && m_sock->HasData() ) { connActive = HandleServerQuery(); + if( !connActive ) break; } if( !connActive ) break; } diff --git a/manual/tracy.tex b/manual/tracy.tex index 874147c3..6735f3fc 100644 --- a/manual/tracy.tex +++ b/manual/tracy.tex @@ -1531,6 +1531,10 @@ void DbgHelpUnlock() { ReleaseMutex(dbgHelpLock); } } \end{lstlisting} +\paragraph{Disabling resolution of inline frames} + +Inline frames retrieval on Windows can be multiple orders of magnitude slower than just performing basic symbol resolution. This is being manifested as profiler seemingly being stuck for a long time, having hundred thousands of query backlog entries queued, which are slowly trickling down. If your use case requires speed of operation rather than having call stacks with inline frames included, you may define the \texttt{TRACY\_NO\_CALLSTACK\_INLINES} macro, which will make the profiler stick to the basic but fast frame resolution mode. + \subsection{Lua support} To profile Lua code using Tracy, include the \texttt{tracy/TracyLua.hpp} header file in your Lua wrapper and execute \texttt{tracy::LuaRegister(lua\_State*)} function to add instrumentation support.