1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-02 13:43:52 +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 ); tracy_free( (void*)ptr );
break; break;
case QueueType::CallstackMemory: case QueueType::CallstackMemory:
ptr = MemRead<uint64_t>( &item.callstackMemory.ptr );
tracy_free( (void*)ptr );
break;
case QueueType::Callstack: case QueueType::Callstack:
ptr = MemRead<uint64_t>( &item.callstack.ptr ); ptr = MemRead<uint64_t>( &item.callstackFat.ptr );
tracy_free( (void*)ptr ); tracy_free( (void*)ptr );
break; break;
case QueueType::CallstackAlloc: case QueueType::CallstackAlloc:
@ -1878,11 +1875,9 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token )
break; break;
} }
case QueueType::Callstack: case QueueType::Callstack:
ptr = MemRead<uint64_t>( &item->callstack.ptr ); ptr = MemRead<uint64_t>( &item->callstackFat.ptr );
SendCallstackPayload( ptr ); SendCallstackPayload( ptr );
tracy_free( (void*)ptr ); tracy_free( (void*)ptr );
idx++;
MemWrite( &item->hdr.idx, idx );
break; break;
case QueueType::CallstackAlloc: case QueueType::CallstackAlloc:
ptr = MemRead<uint64_t>( &item->callstackAlloc.nativePtr ); ptr = MemRead<uint64_t>( &item->callstackAlloc.nativePtr );
@ -2107,11 +2102,9 @@ Profiler::DequeueStatus Profiler::DequeueSerial()
switch( (QueueType)idx ) switch( (QueueType)idx )
{ {
case QueueType::CallstackMemory: case QueueType::CallstackMemory:
ptr = MemRead<uint64_t>( &item->callstackMemory.ptr ); ptr = MemRead<uint64_t>( &item->callstackFat.ptr );
SendCallstackPayload( ptr ); SendCallstackPayload( ptr );
tracy_free( (void*)ptr ); tracy_free( (void*)ptr );
idx++;
MemWrite( &item->hdr.idx, idx );
break; break;
case QueueType::LockWait: case QueueType::LockWait:
case QueueType::LockSharedWait: case QueueType::LockSharedWait:
@ -2818,7 +2811,7 @@ void Profiler::SendCallstack( int depth, const char* skipBefore )
CutCallstack( ptr, skipBefore ); CutCallstack( ptr, skipBefore );
TracyLfqPrepare( QueueType::Callstack ); TracyLfqPrepare( QueueType::Callstack );
MemWrite( &item->callstack.ptr, (uint64_t)ptr ); MemWrite( &item->callstackFat.ptr, (uint64_t)ptr );
TracyLfqCommit; TracyLfqCommit;
#endif #endif
} }

View File

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

View File

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

View File

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