diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 1daef593..3ea6d87e 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1743,7 +1743,7 @@ static void FreeAssociatedMemory( const QueueItem& item ) tracy_free( (void*)ptr ); break; case QueueType::CallstackSample: - ptr = MemRead( &item.callstackSample.ptr ); + ptr = MemRead( &item.callstackSampleFat.ptr ); tracy_free( (void*)ptr ); break; case QueueType::FrameImage: @@ -1893,15 +1893,13 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token ) break; case QueueType::CallstackSample: { - ptr = MemRead( &item->callstackSample.ptr ); + ptr = MemRead( &item->callstackSampleFat.ptr ); SendCallstackPayload64( ptr ); tracy_free( (void*)ptr ); - int64_t t = MemRead( &item->callstackSample.time ); + int64_t t = MemRead( &item->callstackSampleFat.time ); int64_t dt = t - refCtx; refCtx = t; - MemWrite( &item->callstackSample.time, dt ); - idx++; - MemWrite( &item->hdr.idx, idx ); + MemWrite( &item->callstackSampleFat.time, dt ); break; } case QueueType::FrameImage: diff --git a/client/TracySysTrace.cpp b/client/TracySysTrace.cpp index 6048b9a1..fef0f128 100644 --- a/client/TracySysTrace.cpp +++ b/client/TracySysTrace.cpp @@ -186,9 +186,9 @@ void WINAPI EventRecordCallback( PEVENT_RECORD record ) memcpy( trace, &sz, sizeof( uint64_t ) ); memcpy( trace+1, sw->stack, sizeof( uint64_t ) * sz ); TracyLfqPrepare( QueueType::CallstackSample ); - MemWrite( &item->callstackSample.time, sw->eventTimeStamp ); - MemWrite( &item->callstackSample.thread, (uint64_t)sw->stackThread ); - MemWrite( &item->callstackSample.ptr, (uint64_t)trace ); + MemWrite( &item->callstackSampleFat.time, sw->eventTimeStamp ); + MemWrite( &item->callstackSampleFat.thread, (uint64_t)sw->stackThread ); + MemWrite( &item->callstackSampleFat.ptr, (uint64_t)trace ); TracyLfqCommit; } } diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 17fdbab1..d167e6de 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -23,7 +23,6 @@ enum class QueueType : uint8_t Callstack, CallstackAlloc, CallstackSample, - CallstackSampleLean, FrameImage, ZoneBegin, ZoneBeginCallstack, @@ -365,13 +364,13 @@ struct QueueCallstackAllocFat uint64_t nativePtr; }; -struct QueueCallstackSampleLean +struct QueueCallstackSample { int64_t time; uint64_t thread; }; -struct QueueCallstackSample : public QueueCallstackSampleLean +struct QueueCallstackSampleFat : public QueueCallstackSample { uint64_t ptr; }; @@ -514,7 +513,7 @@ struct QueueItem QueueCallstackFat callstackFat; QueueCallstackAllocFat callstackAllocFat; QueueCallstackSample callstackSample; - QueueCallstackSampleLean callstackSampleLean; + QueueCallstackSampleFat callstackSampleFat; QueueCallstackFrameSize callstackFrameSize; QueueCallstackFrame callstackFrame; QueueSymbolInformation symbolInformation; @@ -549,8 +548,7 @@ static constexpr size_t QueueDataSize[] = { sizeof( QueueHeader ), // callstack memory sizeof( QueueHeader ), // callstack sizeof( QueueHeader ), // callstack alloc - sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), // not for network transfer - sizeof( QueueHeader ) + sizeof( QueueCallstackSampleLean ), + sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), sizeof( QueueHeader ) + sizeof( QueueFrameImage ), sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), // callstack diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 4b19c065..f2c660b6 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -4032,8 +4032,8 @@ bool Worker::Process( const QueueItem& ev ) case QueueType::CallstackAlloc: ProcessCallstackAlloc(); break; - case QueueType::CallstackSampleLean: - ProcessCallstackSample( ev.callstackSampleLean ); + case QueueType::CallstackSample: + ProcessCallstackSample( ev.callstackSample ); break; case QueueType::CallstackFrameSize: ProcessCallstackFrameSize( ev.callstackFrameSize ); @@ -5288,7 +5288,7 @@ void Worker::ProcessCallstackAlloc() } } -void Worker::ProcessCallstackSample( const QueueCallstackSampleLean& ev ) +void Worker::ProcessCallstackSample( const QueueCallstackSample& ev ) { assert( m_pendingCallstackPtr != 0 ); m_pendingCallstackPtr = 0; diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 7b191ef7..c776f8e7 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -651,7 +651,7 @@ private: tracy_force_inline void ProcessCallstackMemory(); tracy_force_inline void ProcessCallstack(); tracy_force_inline void ProcessCallstackAlloc(); - tracy_force_inline void ProcessCallstackSample( const QueueCallstackSampleLean& ev ); + tracy_force_inline void ProcessCallstackSample( const QueueCallstackSample& ev ); tracy_force_inline void ProcessCallstackFrameSize( const QueueCallstackFrameSize& ev ); tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev ); tracy_force_inline void ProcessSymbolInformation( const QueueSymbolInformation& ev );