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,20 +3047,8 @@ void Profiler::QueueExternalName( uint64_t ptr )
|
||||
}
|
||||
|
||||
#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 )
|
||||
{
|
||||
case SymbolQueueItemType::CallstackFrame:
|
||||
@ -3128,6 +3116,23 @@ void Profiler::SymbolWorker()
|
||||
assert( false );
|
||||
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
|
||||
{
|
||||
|
@ -680,6 +680,7 @@ private:
|
||||
#ifdef TRACY_HAS_CALLSTACK
|
||||
static void LaunchSymbolWorker( void* ptr ) { ((Profiler*)ptr)->SymbolWorker(); }
|
||||
void SymbolWorker();
|
||||
void HandleSymbolQueueItem( const SymbolQueueItem& si );
|
||||
#endif
|
||||
|
||||
void ClearQueues( tracy::moodycamel::ConsumerToken& token );
|
||||
|
Loading…
Reference in New Issue
Block a user