diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index a01de767..238ce251 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -2036,7 +2036,7 @@ Profiler::DequeueStatus Profiler::DequeueSerial() while( item != end ) { uint64_t ptr; - const auto idx = MemRead( &item->hdr.idx ); + auto idx = MemRead( &item->hdr.idx ); if( idx < (int)QueueType::Terminate ) { switch( (QueueType)idx ) @@ -2045,6 +2045,8 @@ Profiler::DequeueStatus Profiler::DequeueSerial() ptr = MemRead( &item->callstackMemory.ptr ); SendCallstackPayload( ptr ); tracy_free( (void*)ptr ); + idx++; + MemWrite( &item->hdr.idx, idx ); break; case QueueType::LockWait: case QueueType::LockSharedWait: diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 833ace4c..36bf58b4 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -20,6 +20,7 @@ enum class QueueType : uint8_t ZoneBeginAllocSrcLocCallstack, ZoneBeginAllocSrcLocCallstackLean, CallstackMemory, + CallstackMemoryLean, Callstack, CallstackAlloc, CallstackSample, @@ -482,7 +483,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 ), + sizeof( QueueHeader ) + sizeof( QueueCallstackMemory ), // not for network transfer + sizeof( QueueHeader ), // lean callstack memory sizeof( QueueHeader ) + sizeof( QueueCallstack ), sizeof( QueueHeader ) + sizeof( QueueCallstackAlloc ), sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index bc86f759..fe2da5cf 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -4182,8 +4182,8 @@ bool Worker::Process( const QueueItem& ev ) case QueueType::MemFreeCallstack: ProcessMemFreeCallstack( ev.memFree ); break; - case QueueType::CallstackMemory: - ProcessCallstackMemory( ev.callstackMemory ); + case QueueType::CallstackMemoryLean: + ProcessCallstackMemory(); break; case QueueType::Callstack: ProcessCallstack( ev.callstack ); @@ -5315,9 +5315,9 @@ void Worker::ProcessMemFreeCallstack( const QueueMemFree& ev ) } } -void Worker::ProcessCallstackMemory( const QueueCallstackMemory& ev ) +void Worker::ProcessCallstackMemory() { - assert( m_pendingCallstackPtr == ev.ptr ); + assert( m_pendingCallstackPtr != 0 ); m_pendingCallstackPtr = 0; if( m_lastMemActionCallstack != std::numeric_limits::max() ) diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index daf1cf75..63043c48 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -599,7 +599,7 @@ private: tracy_force_inline bool ProcessMemFree( const QueueMemFree& ev ); tracy_force_inline void ProcessMemAllocCallstack( const QueueMemAlloc& ev ); tracy_force_inline void ProcessMemFreeCallstack( const QueueMemFree& ev ); - tracy_force_inline void ProcessCallstackMemory( const QueueCallstackMemory& ev ); + tracy_force_inline void ProcessCallstackMemory(); tracy_force_inline void ProcessCallstack( const QueueCallstack& ev ); tracy_force_inline void ProcessCallstackAlloc( const QueueCallstackAlloc& ev ); tracy_force_inline void ProcessCallstackSample( const QueueCallstackSample& ev );