diff options
author | Bartosz Taudul <wolf@nereid.pl> | 2021-12-21 16:05:07 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf@nereid.pl> | 2021-12-21 16:05:07 +0300 |
commit | d88bf2c7a85fb1d8c72d268c8d0a8f977733776c (patch) | |
tree | 04c9a621a46823dcfa43052626f4de8cab9197e2 | |
parent | 0ba2c0a86ea3c0620312987b5635efaaf9c84c26 (diff) |
Separate message type for context switch callstack samples.
-rw-r--r-- | client/TracyProfiler.cpp | 2 | ||||
-rw-r--r-- | client/TracySysTrace.cpp | 2 | ||||
-rw-r--r-- | common/TracyProtocol.hpp | 2 | ||||
-rw-r--r-- | common/TracyQueue.hpp | 2 | ||||
-rw-r--r-- | server/TracyEventDebug.cpp | 3 |
5 files changed, 9 insertions, 2 deletions
diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index f08e375a..6fcf48a4 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -2090,6 +2090,7 @@ static void FreeAssociatedMemory( const QueueItem& item ) tracy_free( (void*)ptr ); break; case QueueType::CallstackSample: + case QueueType::CallstackSampleContextSwitch: ptr = MemRead<uint64_t>( &item.callstackSampleFat.ptr ); tracy_free( (void*)ptr ); break; @@ -2283,6 +2284,7 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token ) tracy_free_fast( (void*)ptr ); break; case QueueType::CallstackSample: + case QueueType::CallstackSampleContextSwitch: { ptr = MemRead<uint64_t>( &item->callstackSampleFat.ptr ); SendCallstackPayload64( ptr ); diff --git a/client/TracySysTrace.cpp b/client/TracySysTrace.cpp index 1b35fac1..109897ed 100644 --- a/client/TracySysTrace.cpp +++ b/client/TracySysTrace.cpp @@ -1401,7 +1401,7 @@ void SysTraceWorker( void* ptr ) { auto trace = GetCallstackBlock( cnt, ring, traceOffset ); - TracyLfqPrepare( QueueType::CallstackSample ); + TracyLfqPrepare( QueueType::CallstackSampleContextSwitch ); MemWrite( &item->callstackSampleFat.time, t0 ); MemWrite( &item->callstackSampleFat.thread, prev_pid ); MemWrite( &item->callstackSampleFat.ptr, (uint64_t)trace ); diff --git a/common/TracyProtocol.hpp b/common/TracyProtocol.hpp index 1cd46346..a647b031 100644 --- a/common/TracyProtocol.hpp +++ b/common/TracyProtocol.hpp @@ -9,7 +9,7 @@ namespace tracy constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; } -enum : uint32_t { ProtocolVersion = 54 }; +enum : uint32_t { ProtocolVersion = 55 }; enum : uint16_t { BroadcastVersion = 2 }; using lz4sz_t = uint32_t; diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 27cb5501..4deb1910 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -21,6 +21,7 @@ enum class QueueType : uint8_t Callstack, CallstackAlloc, CallstackSample, + CallstackSampleContextSwitch, FrameImage, ZoneBegin, ZoneBeginCallstack, @@ -741,6 +742,7 @@ static constexpr size_t QueueDataSize[] = { sizeof( QueueHeader ), // callstack sizeof( QueueHeader ), // callstack alloc sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), + sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), // context switch sizeof( QueueHeader ) + sizeof( QueueFrameImage ), sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), // callstack diff --git a/server/TracyEventDebug.cpp b/server/TracyEventDebug.cpp index 1a027b05..317a9029 100644 --- a/server/TracyEventDebug.cpp +++ b/server/TracyEventDebug.cpp @@ -52,6 +52,9 @@ void EventDebug( const QueueItem& ev ) case QueueType::CallstackSample: fprintf( f, "ev %i (CallstackSample)\n", ev.hdr.idx ); break; + case QueueType::CallstackSampleContextSwitch: + fprintf( f, "ev %i (CallstackSampleContextSwitch)\n", ev.hdr.idx ); + break; case QueueType::FrameImage: fprintf( f, "ev %i (FrameImage)\n", ev.hdr.idx ); break; |