From 4252cac654fc41a993df13427f8bdb6647b6b36d Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 26 Jul 2020 14:25:32 +0200 Subject: [PATCH] No need for lean callstack alloc message. --- TracyLua.hpp | 4 ++-- client/TracyProfiler.cpp | 10 ++++------ common/TracyQueue.hpp | 8 +++----- server/TracyWorker.cpp | 2 +- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/TracyLua.hpp b/TracyLua.hpp index ea484059..68e21cff 100644 --- a/TracyLua.hpp +++ b/TracyLua.hpp @@ -183,8 +183,8 @@ static tracy_force_inline void SendLuaCallstack( lua_State* L, uint32_t depth ) assert( dst - ptr == spaceNeeded + 2 ); TracyLfqPrepare( QueueType::CallstackAlloc ); - MemWrite( &item->callstackAlloc.ptr, (uint64_t)ptr ); - MemWrite( &item->callstackAlloc.nativePtr, (uint64_t)Callstack( depth ) ); + MemWrite( &item->callstackAllocFat.ptr, (uint64_t)ptr ); + MemWrite( &item->callstackAllocFat.nativePtr, (uint64_t)Callstack( depth ) ); TracyLfqCommit; } diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index a75bd7fa..1daef593 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -1737,9 +1737,9 @@ static void FreeAssociatedMemory( const QueueItem& item ) tracy_free( (void*)ptr ); break; case QueueType::CallstackAlloc: - ptr = MemRead( &item.callstackAlloc.nativePtr ); + ptr = MemRead( &item.callstackAllocFat.nativePtr ); tracy_free( (void*)ptr ); - ptr = MemRead( &item.callstackAlloc.ptr ); + ptr = MemRead( &item.callstackAllocFat.ptr ); tracy_free( (void*)ptr ); break; case QueueType::CallstackSample: @@ -1880,18 +1880,16 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token ) tracy_free( (void*)ptr ); break; case QueueType::CallstackAlloc: - ptr = MemRead( &item->callstackAlloc.nativePtr ); + ptr = MemRead( &item->callstackAllocFat.nativePtr ); if( ptr != 0 ) { CutCallstack( (void*)ptr, "lua_pcall" ); SendCallstackPayload( ptr ); tracy_free( (void*)ptr ); } - ptr = MemRead( &item->callstackAlloc.ptr ); + ptr = MemRead( &item->callstackAllocFat.ptr ); SendCallstackAlloc( ptr ); tracy_free( (void*)ptr ); - idx++; - MemWrite( &item->hdr.idx, idx ); break; case QueueType::CallstackSample: { diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 5bbcf349..17fdbab1 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -22,7 +22,6 @@ enum class QueueType : uint8_t CallstackMemory, Callstack, CallstackAlloc, - CallstackAllocLean, CallstackSample, CallstackSampleLean, FrameImage, @@ -360,7 +359,7 @@ struct QueueCallstackFat uint64_t ptr; }; -struct QueueCallstackAlloc +struct QueueCallstackAllocFat { uint64_t ptr; uint64_t nativePtr; @@ -513,7 +512,7 @@ struct QueueItem QueueMemAlloc memAlloc; QueueMemFree memFree; QueueCallstackFat callstackFat; - QueueCallstackAlloc callstackAlloc; + QueueCallstackAllocFat callstackAllocFat; QueueCallstackSample callstackSample; QueueCallstackSampleLean callstackSampleLean; QueueCallstackFrameSize callstackFrameSize; @@ -549,8 +548,7 @@ static constexpr size_t QueueDataSize[] = { sizeof( QueueHeader ) + sizeof( QueueZoneBeginLean ), // lean allocated source location, callstack sizeof( QueueHeader ), // callstack memory sizeof( QueueHeader ), // callstack - sizeof( QueueHeader ) + sizeof( QueueCallstackAlloc ), // not for network transfer - sizeof( QueueHeader ), // lean callstack alloc + sizeof( QueueHeader ), // callstack alloc sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), // not for network transfer sizeof( QueueHeader ) + sizeof( QueueCallstackSampleLean ), sizeof( QueueHeader ) + sizeof( QueueFrameImage ), diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index b2810612..4b19c065 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -4029,7 +4029,7 @@ bool Worker::Process( const QueueItem& ev ) case QueueType::Callstack: ProcessCallstack(); break; - case QueueType::CallstackAllocLean: + case QueueType::CallstackAlloc: ProcessCallstackAlloc(); break; case QueueType::CallstackSampleLean: