1
0
mirror of https://github.com/wolfpld/tracy synced 2025-01-15 11:57:59 +00:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Bartosz Taudul
68948712b4
Don't sleep if queues are empty, but there's queries to handle. 2021-05-22 01:12:42 +02:00
Bartosz Taudul
6bb05c5b97
Update NEWS. 2021-05-22 01:12:33 +02:00
Bartosz Taudul
1e6aedf9e6
Limit client query response rate.
Original idea by xavier <xavierb@gmail.com>
2021-05-22 01:05:06 +02:00
Bartosz Taudul
621d1b03cd
Update manual. 2021-05-21 22:28:38 +02:00
Bartosz Taudul
0f8ea78cd4
Update NEWS. 2021-05-21 22:28:38 +02:00
Bartosz Taudul
d7541bbdba
Allow disabling inline resolution on windows.
Original commit a6b25497 by xavier <xavierb@gmail.com>:

add TRACY_CALLSTACK_IGNORE_INLINES to tradeoff speed vs precision in win32 DecodeCallstackPtr()

SymQueryInlineTrace() is too slow in some cases:
300000 queries backlog getting processed at ~70 per second is prohibitive.

(without inlines resolution, it's more like ~20000 queries per second)
2021-05-21 22:27:35 +02:00
4 changed files with 19 additions and 5 deletions

8
NEWS
View File

@ -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)
-------------------

View File

@ -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; i<inlineNum; i++ )

View File

@ -1676,7 +1676,7 @@ void Profiler::Worker()
keepAlive = 0;
}
else
else if( !m_sock->HasData() )
{
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;
}

View File

@ -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.