Process callstack queue event.

This commit is contained in:
Bartosz Taudul 2018-06-22 01:15:49 +02:00
parent 205a4e4ca2
commit 5e01a8ead9
2 changed files with 26 additions and 0 deletions

View File

@ -1576,6 +1576,9 @@ void Worker::Process( const QueueItem& ev )
case QueueType::CallstackMemory:
ProcessCallstackMemory( ev.callstackMemory );
break;
case QueueType::Callstack:
ProcessCallstack( ev.callstack );
break;
case QueueType::CallstackFrame:
ProcessCallstackFrame( ev.callstackFrame );
break;
@ -2147,6 +2150,28 @@ void Worker::ProcessCallstackMemory( const QueueCallstackMemory& ev )
m_pendingCallstacks.erase( it );
}
void Worker::ProcessCallstack( const QueueCallstack& ev )
{
auto it = m_pendingCallstacks.find( ev.ptr );
assert( it != m_pendingCallstacks.end() );
auto nit = m_nextCallstack.find( ev.thread );
assert( nit != m_nextCallstack.end() );
auto& next = nit->second;
switch( next.type )
{
case NextCallstackType::Zone:
next.zone->callstack = it->second;
break;
default:
assert( false );
break;
}
m_pendingCallstacks.erase( it );
}
void Worker::ProcessCallstackFrame( const QueueCallstackFrame& ev )
{
assert( m_pendingCallstackFrames > 0 );

View File

@ -237,6 +237,7 @@ private:
tracy_force_inline void ProcessMemAllocCallstack( const QueueMemAlloc& ev );
tracy_force_inline void ProcessMemFreeCallstack( const QueueMemFree& ev );
tracy_force_inline void ProcessCallstackMemory( const QueueCallstackMemory& ev );
tracy_force_inline void ProcessCallstack( const QueueCallstack& ev );
tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev );
tracy_force_inline void ProcessZoneBeginImpl( ZoneEvent* zone, const QueueZoneBegin& ev );