1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 20:33:52 +00:00

Send lean callstack allocs.

This commit is contained in:
Bartosz Taudul 2020-05-10 19:56:36 +02:00
parent 5a774c82cc
commit 09388f3c99
4 changed files with 10 additions and 6 deletions

View File

@ -1831,6 +1831,8 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token )
ptr = MemRead<uint64_t>( &item->callstackAlloc.ptr ); ptr = MemRead<uint64_t>( &item->callstackAlloc.ptr );
SendCallstackAlloc( ptr ); SendCallstackAlloc( ptr );
tracy_free( (void*)ptr ); tracy_free( (void*)ptr );
idx++;
MemWrite( &item->hdr.idx, idx );
break; break;
case QueueType::CallstackSample: case QueueType::CallstackSample:
{ {

View File

@ -24,6 +24,7 @@ enum class QueueType : uint8_t
Callstack, Callstack,
CallstackLean, CallstackLean,
CallstackAlloc, CallstackAlloc,
CallstackAllocLean,
CallstackSample, CallstackSample,
FrameImage, FrameImage,
ZoneBegin, ZoneBegin,
@ -488,7 +489,8 @@ static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ), // lean callstack memory sizeof( QueueHeader ), // lean callstack memory
sizeof( QueueHeader ) + sizeof( QueueCallstack ), // not for network transfer sizeof( QueueHeader ) + sizeof( QueueCallstack ), // not for network transfer
sizeof( QueueHeader ), // lean callstack sizeof( QueueHeader ), // lean callstack
sizeof( QueueHeader ) + sizeof( QueueCallstackAlloc ), sizeof( QueueHeader ) + sizeof( QueueCallstackAlloc ), // not for network transfer
sizeof( QueueHeader ), // lean callstack alloc
sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), sizeof( QueueHeader ) + sizeof( QueueCallstackSample ),
sizeof( QueueHeader ) + sizeof( QueueFrameImage ), sizeof( QueueHeader ) + sizeof( QueueFrameImage ),
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), sizeof( QueueHeader ) + sizeof( QueueZoneBegin ),

View File

@ -4188,8 +4188,8 @@ bool Worker::Process( const QueueItem& ev )
case QueueType::CallstackLean: case QueueType::CallstackLean:
ProcessCallstack(); ProcessCallstack();
break; break;
case QueueType::CallstackAlloc: case QueueType::CallstackAllocLean:
ProcessCallstackAlloc( ev.callstackAlloc ); ProcessCallstackAlloc();
break; break;
case QueueType::CallstackSample: case QueueType::CallstackSample:
ProcessCallstackSample( ev.callstackSample ); ProcessCallstackSample( ev.callstackSample );
@ -5371,9 +5371,9 @@ void Worker::ProcessCallstack()
} }
} }
void Worker::ProcessCallstackAlloc( const QueueCallstackAlloc& ev ) void Worker::ProcessCallstackAlloc()
{ {
assert( m_pendingCallstackPtr == ev.ptr ); assert( m_pendingCallstackPtr != 0 );
m_pendingCallstackPtr = 0; m_pendingCallstackPtr = 0;
auto nit = m_nextCallstack.find( m_threadCtx ); auto nit = m_nextCallstack.find( m_threadCtx );

View File

@ -601,7 +601,7 @@ private:
tracy_force_inline void ProcessMemFreeCallstack( const QueueMemFree& ev ); tracy_force_inline void ProcessMemFreeCallstack( const QueueMemFree& ev );
tracy_force_inline void ProcessCallstackMemory(); tracy_force_inline void ProcessCallstackMemory();
tracy_force_inline void ProcessCallstack(); tracy_force_inline void ProcessCallstack();
tracy_force_inline void ProcessCallstackAlloc( const QueueCallstackAlloc& ev ); tracy_force_inline void ProcessCallstackAlloc();
tracy_force_inline void ProcessCallstackSample( const QueueCallstackSample& ev ); tracy_force_inline void ProcessCallstackSample( const QueueCallstackSample& ev );
tracy_force_inline void ProcessCallstackFrameSize( const QueueCallstackFrameSize& ev ); tracy_force_inline void ProcessCallstackFrameSize( const QueueCallstackFrameSize& ev );
tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev ); tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev );