1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Handle ZoneBeginCallstack queue event.

This is identical to ZoneBegin handling, but requires some additional
bookkeeping to account for the incoming callstack information.
This commit is contained in:
Bartosz Taudul
2018-06-22 01:07:25 +02:00
parent b6088b908f
commit 978e168cbd
2 changed files with 38 additions and 3 deletions
+18
View File
@@ -119,6 +119,20 @@ class Worker
float compRatio;
};
enum class NextCallstackType
{
Zone
};
struct NextCallstack
{
NextCallstackType type;
union
{
ZoneEvent* zone;
};
};
public:
Worker( const char* addr );
Worker( FileRead& f, EventType::Type eventMask = EventType::All );
@@ -197,6 +211,7 @@ private:
tracy_force_inline void DispatchProcess( const QueueItem& ev, char*& ptr );
tracy_force_inline void Process( const QueueItem& ev );
tracy_force_inline void ProcessZoneBegin( const QueueZoneBegin& ev );
tracy_force_inline void ProcessZoneBeginCallstack( const QueueZoneBegin& ev );
tracy_force_inline void ProcessZoneBeginAllocSrcLoc( const QueueZoneBegin& ev );
tracy_force_inline void ProcessZoneEnd( const QueueZoneEnd& ev );
tracy_force_inline void ProcessFrameMark( const QueueFrameMark& ev );
@@ -224,6 +239,8 @@ private:
tracy_force_inline void ProcessCallstackMemory( const QueueCallstackMemory& ev );
tracy_force_inline void ProcessCallstackFrame( const QueueCallstackFrame& ev );
tracy_force_inline void ProcessZoneBeginImpl( ZoneEvent* zone, const QueueZoneBegin& ev );
tracy_force_inline void CheckSourceLocation( uint64_t ptr );
void NewSourceLocation( uint64_t ptr );
tracy_force_inline uint32_t ShrinkSourceLocation( uint64_t srcloc );
@@ -306,6 +323,7 @@ private:
Vector<uint64_t> m_sourceLocationQueue;
flat_hash_map<uint64_t, uint32_t, nohash<uint64_t>> m_sourceLocationShrink;
flat_hash_map<uint64_t, ThreadData*, nohash<uint64_t>> m_threadMap;
flat_hash_map<uint64_t, NextCallstack, nohash<uint64_t>> m_nextCallstack;
uint32_t m_pendingStrings;
uint32_t m_pendingThreads;