mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Extract symbol queue item handling.
This commit is contained in:
parent
2b9265cc40
commit
02ce9b7d8b
@ -3047,19 +3047,7 @@ void Profiler::QueueExternalName( uint64_t ptr )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TRACY_HAS_CALLSTACK
|
#ifdef TRACY_HAS_CALLSTACK
|
||||||
void Profiler::SymbolWorker()
|
void Profiler::HandleSymbolQueueItem( const SymbolQueueItem& si )
|
||||||
{
|
|
||||||
ThreadExitHandler threadExitHandler;
|
|
||||||
SetThreadName( "Tracy Symbol Worker" );
|
|
||||||
while( m_timeBegin.load( std::memory_order_relaxed ) == 0 ) std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
|
|
||||||
rpmalloc_thread_initialize();
|
|
||||||
|
|
||||||
for(;;)
|
|
||||||
{
|
|
||||||
const auto shouldExit = ShouldExit();
|
|
||||||
|
|
||||||
SymbolQueueItem si;
|
|
||||||
if( m_symbolQueue.try_dequeue( si ) )
|
|
||||||
{
|
{
|
||||||
switch( si.type )
|
switch( si.type )
|
||||||
{
|
{
|
||||||
@ -3129,6 +3117,23 @@ void Profiler::SymbolWorker()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 ) );
|
||||||
|
rpmalloc_thread_initialize();
|
||||||
|
|
||||||
|
for(;;)
|
||||||
|
{
|
||||||
|
const auto shouldExit = ShouldExit();
|
||||||
|
|
||||||
|
SymbolQueueItem si;
|
||||||
|
if( m_symbolQueue.try_dequeue( si ) )
|
||||||
|
{
|
||||||
|
HandleSymbolQueueItem( si );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( shouldExit ) return;
|
if( shouldExit ) return;
|
||||||
|
@ -680,6 +680,7 @@ private:
|
|||||||
#ifdef TRACY_HAS_CALLSTACK
|
#ifdef TRACY_HAS_CALLSTACK
|
||||||
static void LaunchSymbolWorker( void* ptr ) { ((Profiler*)ptr)->SymbolWorker(); }
|
static void LaunchSymbolWorker( void* ptr ) { ((Profiler*)ptr)->SymbolWorker(); }
|
||||||
void SymbolWorker();
|
void SymbolWorker();
|
||||||
|
void HandleSymbolQueueItem( const SymbolQueueItem& si );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ClearQueues( tracy::moodycamel::ConsumerToken& token );
|
void ClearQueues( tracy::moodycamel::ConsumerToken& token );
|
||||||
|
Loading…
Reference in New Issue
Block a user