1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +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 );
SendCallstackAlloc( ptr );
tracy_free( (void*)ptr );
idx++;
MemWrite( &item->hdr.idx, idx );
break;
case QueueType::CallstackSample:
{

View File

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

View File

@ -4188,8 +4188,8 @@ bool Worker::Process( const QueueItem& ev )
case QueueType::CallstackLean:
ProcessCallstack();
break;
case QueueType::CallstackAlloc:
ProcessCallstackAlloc( ev.callstackAlloc );
case QueueType::CallstackAllocLean:
ProcessCallstackAlloc();
break;
case QueueType::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;
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 ProcessCallstackMemory();
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 ProcessCallstackFrameSize( const QueueCallstackFrameSize& ev );
tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev );