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:
+20
-3
@@ -1495,6 +1495,9 @@ void Worker::Process( const QueueItem& ev )
|
||||
case QueueType::ZoneBegin:
|
||||
ProcessZoneBegin( ev.zoneBegin );
|
||||
break;
|
||||
case QueueType::ZoneBeginCallstack:
|
||||
ProcessZoneBeginCallstack( ev.zoneBegin );
|
||||
break;
|
||||
case QueueType::ZoneBeginAllocSrcLoc:
|
||||
ProcessZoneBeginAllocSrcLoc( ev.zoneBegin );
|
||||
break;
|
||||
@@ -1585,10 +1588,8 @@ void Worker::Process( const QueueItem& ev )
|
||||
}
|
||||
}
|
||||
|
||||
void Worker::ProcessZoneBegin( const QueueZoneBegin& ev )
|
||||
void Worker::ProcessZoneBeginImpl( ZoneEvent* zone, const QueueZoneBegin& ev )
|
||||
{
|
||||
auto zone = m_slab.AllocInit<ZoneEvent>();
|
||||
|
||||
CheckSourceLocation( ev.srcloc );
|
||||
|
||||
zone->start = TscTime( ev.time );
|
||||
@@ -1602,6 +1603,22 @@ void Worker::ProcessZoneBegin( const QueueZoneBegin& ev )
|
||||
NewZone( zone, ev.thread );
|
||||
}
|
||||
|
||||
void Worker::ProcessZoneBegin( const QueueZoneBegin& ev )
|
||||
{
|
||||
auto zone = m_slab.AllocInit<ZoneEvent>();
|
||||
ProcessZoneBeginImpl( zone, ev );
|
||||
}
|
||||
|
||||
void Worker::ProcessZoneBeginCallstack( const QueueZoneBegin& ev )
|
||||
{
|
||||
auto zone = m_slab.AllocInit<ZoneEvent>();
|
||||
ProcessZoneBeginImpl( zone, ev );
|
||||
|
||||
auto& next = m_nextCallstack[ev.thread];
|
||||
next.type = NextCallstackType::Zone;
|
||||
next.zone = zone;
|
||||
}
|
||||
|
||||
void Worker::ProcessZoneBeginAllocSrcLoc( const QueueZoneBegin& ev )
|
||||
{
|
||||
auto it = m_pendingSourceLocationPayload.find( ev.srcloc );
|
||||
|
||||
Reference in New Issue
Block a user