Send lean callstacks.

This commit is contained in:
Bartosz Taudul 2020-05-10 19:43:12 +02:00
parent f0ade07be8
commit 5a774c82cc
4 changed files with 10 additions and 6 deletions

View File

@ -1817,6 +1817,8 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token )
ptr = MemRead<uint64_t>( &item->callstack.ptr );
SendCallstackPayload( ptr );
tracy_free( (void*)ptr );
idx++;
MemWrite( &item->hdr.idx, idx );
break;
case QueueType::CallstackAlloc:
ptr = MemRead<uint64_t>( &item->callstackAlloc.nativePtr );

View File

@ -22,6 +22,7 @@ enum class QueueType : uint8_t
CallstackMemory,
CallstackMemoryLean,
Callstack,
CallstackLean,
CallstackAlloc,
CallstackSample,
FrameImage,
@ -485,7 +486,8 @@ static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ) + sizeof( QueueZoneBeginLean ), // lean allocated source location, callstack
sizeof( QueueHeader ) + sizeof( QueueCallstackMemory ), // not for network transfer
sizeof( QueueHeader ), // lean callstack memory
sizeof( QueueHeader ) + sizeof( QueueCallstack ),
sizeof( QueueHeader ) + sizeof( QueueCallstack ), // not for network transfer
sizeof( QueueHeader ), // lean callstack
sizeof( QueueHeader ) + sizeof( QueueCallstackAlloc ),
sizeof( QueueHeader ) + sizeof( QueueCallstackSample ),
sizeof( QueueHeader ) + sizeof( QueueFrameImage ),

View File

@ -4185,8 +4185,8 @@ bool Worker::Process( const QueueItem& ev )
case QueueType::CallstackMemoryLean:
ProcessCallstackMemory();
break;
case QueueType::Callstack:
ProcessCallstack( ev.callstack );
case QueueType::CallstackLean:
ProcessCallstack();
break;
case QueueType::CallstackAlloc:
ProcessCallstackAlloc( ev.callstackAlloc );
@ -5334,9 +5334,9 @@ void Worker::ProcessCallstackMemory()
}
}
void Worker::ProcessCallstack( const QueueCallstack& ev )
void Worker::ProcessCallstack()
{
assert( m_pendingCallstackPtr == ev.ptr );
assert( m_pendingCallstackPtr != 0 );
m_pendingCallstackPtr = 0;
auto nit = m_nextCallstack.find( m_threadCtx );

View File

@ -600,7 +600,7 @@ private:
tracy_force_inline void ProcessMemAllocCallstack( const QueueMemAlloc& ev );
tracy_force_inline void ProcessMemFreeCallstack( const QueueMemFree& ev );
tracy_force_inline void ProcessCallstackMemory();
tracy_force_inline void ProcessCallstack( const QueueCallstack& ev );
tracy_force_inline void ProcessCallstack();
tracy_force_inline void ProcessCallstackAlloc( const QueueCallstackAlloc& ev );
tracy_force_inline void ProcessCallstackSample( const QueueCallstackSample& ev );
tracy_force_inline void ProcessCallstackFrameSize( const QueueCallstackFrameSize& ev );