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

Separate message for zone begin with alloc src loc and callstack.

This commit is contained in:
Bartosz Taudul
2019-03-03 17:47:26 +01:00
parent 66b8a13e77
commit bef31ba073
5 changed files with 29 additions and 5 deletions
+21 -3
View File
@@ -2316,6 +2316,9 @@ bool Worker::Process( const QueueItem& ev )
case QueueType::ZoneBeginAllocSrcLoc:
ProcessZoneBeginAllocSrcLoc( ev.zoneBegin );
break;
case QueueType::ZoneBeginAllocSrcLocCallstack:
ProcessZoneBeginAllocSrcLocCallstack( ev.zoneBegin );
break;
case QueueType::ZoneEnd:
ProcessZoneEnd( ev.zoneEnd );
break;
@@ -2407,6 +2410,7 @@ bool Worker::Process( const QueueItem& ev )
ProcessCallstackMemory( ev.callstackMemory );
break;
case QueueType::Callstack:
case QueueType::CallstackAlloc:
ProcessCallstack( ev.callstack );
break;
case QueueType::CallstackFrameSize:
@@ -2470,13 +2474,11 @@ void Worker::ProcessZoneBeginCallstack( const QueueZoneBegin& ev )
next.zone = zone;
}
void Worker::ProcessZoneBeginAllocSrcLoc( const QueueZoneBegin& ev )
void Worker::ProcessZoneBeginAllocSrcLocImpl( ZoneEvent* zone, const QueueZoneBegin& ev )
{
auto it = m_pendingSourceLocationPayload.find( ev.srcloc );
assert( it != m_pendingSourceLocationPayload.end() );
auto zone = m_slab.AllocInit<ZoneEvent>();
zone->start = TscTime( ev.time );
zone->end = -1;
zone->srcloc = it->second;
@@ -2492,6 +2494,22 @@ void Worker::ProcessZoneBeginAllocSrcLoc( const QueueZoneBegin& ev )
m_pendingSourceLocationPayload.erase( it );
}
void Worker::ProcessZoneBeginAllocSrcLoc( const QueueZoneBegin& ev )
{
auto zone = m_slab.AllocInit<ZoneEvent>();
ProcessZoneBeginAllocSrcLocImpl( zone, ev );
}
void Worker::ProcessZoneBeginAllocSrcLocCallstack( const QueueZoneBegin& ev )
{
auto zone = m_slab.AllocInit<ZoneEvent>();
ProcessZoneBeginAllocSrcLocImpl( zone, ev );
auto& next = m_nextCallstack[ev.thread];
next.type = NextCallstackType::Zone;
next.zone = zone;
}
void Worker::ProcessZoneEnd( const QueueZoneEnd& ev )
{
auto tit = m_threadMap.find( ev.thread );