mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-12 19:31:47 +00:00
No need for lean callstack sample message.
This commit is contained in:
parent
4252cac654
commit
062bb3044f
@ -1743,7 +1743,7 @@ static void FreeAssociatedMemory( const QueueItem& item )
|
|||||||
tracy_free( (void*)ptr );
|
tracy_free( (void*)ptr );
|
||||||
break;
|
break;
|
||||||
case QueueType::CallstackSample:
|
case QueueType::CallstackSample:
|
||||||
ptr = MemRead<uint64_t>( &item.callstackSample.ptr );
|
ptr = MemRead<uint64_t>( &item.callstackSampleFat.ptr );
|
||||||
tracy_free( (void*)ptr );
|
tracy_free( (void*)ptr );
|
||||||
break;
|
break;
|
||||||
case QueueType::FrameImage:
|
case QueueType::FrameImage:
|
||||||
@ -1893,15 +1893,13 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token )
|
|||||||
break;
|
break;
|
||||||
case QueueType::CallstackSample:
|
case QueueType::CallstackSample:
|
||||||
{
|
{
|
||||||
ptr = MemRead<uint64_t>( &item->callstackSample.ptr );
|
ptr = MemRead<uint64_t>( &item->callstackSampleFat.ptr );
|
||||||
SendCallstackPayload64( ptr );
|
SendCallstackPayload64( ptr );
|
||||||
tracy_free( (void*)ptr );
|
tracy_free( (void*)ptr );
|
||||||
int64_t t = MemRead<int64_t>( &item->callstackSample.time );
|
int64_t t = MemRead<int64_t>( &item->callstackSampleFat.time );
|
||||||
int64_t dt = t - refCtx;
|
int64_t dt = t - refCtx;
|
||||||
refCtx = t;
|
refCtx = t;
|
||||||
MemWrite( &item->callstackSample.time, dt );
|
MemWrite( &item->callstackSampleFat.time, dt );
|
||||||
idx++;
|
|
||||||
MemWrite( &item->hdr.idx, idx );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QueueType::FrameImage:
|
case QueueType::FrameImage:
|
||||||
|
@ -186,9 +186,9 @@ void WINAPI EventRecordCallback( PEVENT_RECORD record )
|
|||||||
memcpy( trace, &sz, sizeof( uint64_t ) );
|
memcpy( trace, &sz, sizeof( uint64_t ) );
|
||||||
memcpy( trace+1, sw->stack, sizeof( uint64_t ) * sz );
|
memcpy( trace+1, sw->stack, sizeof( uint64_t ) * sz );
|
||||||
TracyLfqPrepare( QueueType::CallstackSample );
|
TracyLfqPrepare( QueueType::CallstackSample );
|
||||||
MemWrite( &item->callstackSample.time, sw->eventTimeStamp );
|
MemWrite( &item->callstackSampleFat.time, sw->eventTimeStamp );
|
||||||
MemWrite( &item->callstackSample.thread, (uint64_t)sw->stackThread );
|
MemWrite( &item->callstackSampleFat.thread, (uint64_t)sw->stackThread );
|
||||||
MemWrite( &item->callstackSample.ptr, (uint64_t)trace );
|
MemWrite( &item->callstackSampleFat.ptr, (uint64_t)trace );
|
||||||
TracyLfqCommit;
|
TracyLfqCommit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ enum class QueueType : uint8_t
|
|||||||
Callstack,
|
Callstack,
|
||||||
CallstackAlloc,
|
CallstackAlloc,
|
||||||
CallstackSample,
|
CallstackSample,
|
||||||
CallstackSampleLean,
|
|
||||||
FrameImage,
|
FrameImage,
|
||||||
ZoneBegin,
|
ZoneBegin,
|
||||||
ZoneBeginCallstack,
|
ZoneBeginCallstack,
|
||||||
@ -365,13 +364,13 @@ struct QueueCallstackAllocFat
|
|||||||
uint64_t nativePtr;
|
uint64_t nativePtr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QueueCallstackSampleLean
|
struct QueueCallstackSample
|
||||||
{
|
{
|
||||||
int64_t time;
|
int64_t time;
|
||||||
uint64_t thread;
|
uint64_t thread;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct QueueCallstackSample : public QueueCallstackSampleLean
|
struct QueueCallstackSampleFat : public QueueCallstackSample
|
||||||
{
|
{
|
||||||
uint64_t ptr;
|
uint64_t ptr;
|
||||||
};
|
};
|
||||||
@ -514,7 +513,7 @@ struct QueueItem
|
|||||||
QueueCallstackFat callstackFat;
|
QueueCallstackFat callstackFat;
|
||||||
QueueCallstackAllocFat callstackAllocFat;
|
QueueCallstackAllocFat callstackAllocFat;
|
||||||
QueueCallstackSample callstackSample;
|
QueueCallstackSample callstackSample;
|
||||||
QueueCallstackSampleLean callstackSampleLean;
|
QueueCallstackSampleFat callstackSampleFat;
|
||||||
QueueCallstackFrameSize callstackFrameSize;
|
QueueCallstackFrameSize callstackFrameSize;
|
||||||
QueueCallstackFrame callstackFrame;
|
QueueCallstackFrame callstackFrame;
|
||||||
QueueSymbolInformation symbolInformation;
|
QueueSymbolInformation symbolInformation;
|
||||||
@ -549,8 +548,7 @@ static constexpr size_t QueueDataSize[] = {
|
|||||||
sizeof( QueueHeader ), // callstack memory
|
sizeof( QueueHeader ), // callstack memory
|
||||||
sizeof( QueueHeader ), // callstack
|
sizeof( QueueHeader ), // callstack
|
||||||
sizeof( QueueHeader ), // callstack alloc
|
sizeof( QueueHeader ), // callstack alloc
|
||||||
sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), // not for network transfer
|
sizeof( QueueHeader ) + sizeof( QueueCallstackSample ),
|
||||||
sizeof( QueueHeader ) + sizeof( QueueCallstackSampleLean ),
|
|
||||||
sizeof( QueueHeader ) + sizeof( QueueFrameImage ),
|
sizeof( QueueHeader ) + sizeof( QueueFrameImage ),
|
||||||
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ),
|
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ),
|
||||||
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), // callstack
|
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), // callstack
|
||||||
|
@ -4032,8 +4032,8 @@ bool Worker::Process( const QueueItem& ev )
|
|||||||
case QueueType::CallstackAlloc:
|
case QueueType::CallstackAlloc:
|
||||||
ProcessCallstackAlloc();
|
ProcessCallstackAlloc();
|
||||||
break;
|
break;
|
||||||
case QueueType::CallstackSampleLean:
|
case QueueType::CallstackSample:
|
||||||
ProcessCallstackSample( ev.callstackSampleLean );
|
ProcessCallstackSample( ev.callstackSample );
|
||||||
break;
|
break;
|
||||||
case QueueType::CallstackFrameSize:
|
case QueueType::CallstackFrameSize:
|
||||||
ProcessCallstackFrameSize( ev.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 );
|
assert( m_pendingCallstackPtr != 0 );
|
||||||
m_pendingCallstackPtr = 0;
|
m_pendingCallstackPtr = 0;
|
||||||
|
@ -651,7 +651,7 @@ private:
|
|||||||
tracy_force_inline void ProcessCallstackMemory();
|
tracy_force_inline void ProcessCallstackMemory();
|
||||||
tracy_force_inline void ProcessCallstack();
|
tracy_force_inline void ProcessCallstack();
|
||||||
tracy_force_inline void ProcessCallstackAlloc();
|
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 ProcessCallstackFrameSize( const QueueCallstackFrameSize& ev );
|
||||||
tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev );
|
tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev );
|
||||||
tracy_force_inline void ProcessSymbolInformation( const QueueSymbolInformation& ev );
|
tracy_force_inline void ProcessSymbolInformation( const QueueSymbolInformation& ev );
|
||||||
|
Loading…
Reference in New Issue
Block a user