mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Separate message type for context switch callstack samples.
This commit is contained in:
parent
0ba2c0a86e
commit
d88bf2c7a8
@ -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 );
|
||||
|
@ -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 );
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user