1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 04:23:51 +00:00

No need for lean callstack, callstack memory messages.

This commit is contained in:
Bartosz Taudul 2020-07-26 14:15:16 +02:00
parent 14a15bf152
commit b76726c597
4 changed files with 12 additions and 29 deletions

View File

@ -1732,11 +1732,8 @@ static void FreeAssociatedMemory( const QueueItem& item )
tracy_free( (void*)ptr );
break;
case QueueType::CallstackMemory:
ptr = MemRead<uint64_t>( &item.callstackMemory.ptr );
tracy_free( (void*)ptr );
break;
case QueueType::Callstack:
ptr = MemRead<uint64_t>( &item.callstack.ptr );
ptr = MemRead<uint64_t>( &item.callstackFat.ptr );
tracy_free( (void*)ptr );
break;
case QueueType::CallstackAlloc:
@ -1878,11 +1875,9 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token )
break;
}
case QueueType::Callstack:
ptr = MemRead<uint64_t>( &item->callstack.ptr );
ptr = MemRead<uint64_t>( &item->callstackFat.ptr );
SendCallstackPayload( ptr );
tracy_free( (void*)ptr );
idx++;
MemWrite( &item->hdr.idx, idx );
break;
case QueueType::CallstackAlloc:
ptr = MemRead<uint64_t>( &item->callstackAlloc.nativePtr );
@ -2107,11 +2102,9 @@ Profiler::DequeueStatus Profiler::DequeueSerial()
switch( (QueueType)idx )
{
case QueueType::CallstackMemory:
ptr = MemRead<uint64_t>( &item->callstackMemory.ptr );
ptr = MemRead<uint64_t>( &item->callstackFat.ptr );
SendCallstackPayload( ptr );
tracy_free( (void*)ptr );
idx++;
MemWrite( &item->hdr.idx, idx );
break;
case QueueType::LockWait:
case QueueType::LockSharedWait:
@ -2818,7 +2811,7 @@ void Profiler::SendCallstack( int depth, const char* skipBefore )
CutCallstack( ptr, skipBefore );
TracyLfqPrepare( QueueType::Callstack );
MemWrite( &item->callstack.ptr, (uint64_t)ptr );
MemWrite( &item->callstackFat.ptr, (uint64_t)ptr );
TracyLfqCommit;
#endif
}

View File

@ -435,7 +435,7 @@ public:
#ifdef TRACY_HAS_CALLSTACK
auto ptr = Callstack( depth );
TracyLfqPrepare( QueueType::Callstack );
MemWrite( &item->callstack.ptr, (uint64_t)ptr );
MemWrite( &item->callstackFat.ptr, (uint64_t)ptr );
TracyLfqCommit;
#endif
}
@ -602,7 +602,7 @@ private:
#ifdef TRACY_HAS_CALLSTACK
auto item = GetProfiler().m_serialQueue.prepare_next();
MemWrite( &item->hdr.type, QueueType::CallstackMemory );
MemWrite( &item->callstackMemory.ptr, (uint64_t)ptr );
MemWrite( &item->callstackFat.ptr, (uint64_t)ptr );
GetProfiler().m_serialQueue.commit_next();
#endif
}

View File

@ -20,9 +20,7 @@ enum class QueueType : uint8_t
ZoneBeginAllocSrcLocCallstack,
ZoneBeginAllocSrcLocCallstackLean,
CallstackMemory,
CallstackMemoryLean,
Callstack,
CallstackLean,
CallstackAlloc,
CallstackAllocLean,
CallstackSample,
@ -358,12 +356,7 @@ struct QueueMemFree
uint64_t ptr;
};
struct QueueCallstackMemory
{
uint64_t ptr;
};
struct QueueCallstack
struct QueueCallstackFat
{
uint64_t ptr;
};
@ -520,8 +513,7 @@ struct QueueItem
QueueGpuCalibration gpuCalibration;
QueueMemAlloc memAlloc;
QueueMemFree memFree;
QueueCallstackMemory callstackMemory;
QueueCallstack callstack;
QueueCallstackFat callstackFat;
QueueCallstackAlloc callstackAlloc;
QueueCallstackSample callstackSample;
QueueCallstackSampleLean callstackSampleLean;
@ -556,10 +548,8 @@ static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ) + sizeof( QueueZoneBeginLean ), // lean allocated source location
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), // allocated source location, callstack, not for network transfer
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 ), // not for network transfer
sizeof( QueueHeader ), // lean callstack
sizeof( QueueHeader ), // callstack memory
sizeof( QueueHeader ), // callstack
sizeof( QueueHeader ) + sizeof( QueueCallstackAlloc ), // not for network transfer
sizeof( QueueHeader ), // lean callstack alloc
sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), // not for network transfer

View File

@ -4023,10 +4023,10 @@ bool Worker::Process( const QueueItem& ev )
case QueueType::MemFreeCallstack:
ProcessMemFreeCallstack( ev.memFree );
break;
case QueueType::CallstackMemoryLean:
case QueueType::CallstackMemory:
ProcessCallstackMemory();
break;
case QueueType::CallstackLean:
case QueueType::Callstack:
ProcessCallstack();
break;
case QueueType::CallstackAllocLean: