Add callstack index to ZoneEvent.

This commit is contained in:
Bartosz Taudul 2018-06-22 01:11:03 +02:00
parent 978e168cbd
commit 205a4e4ca2
2 changed files with 3 additions and 0 deletions

View File

@ -80,6 +80,7 @@ struct ZoneEvent
int8_t cpu_start; int8_t cpu_start;
int8_t cpu_end; int8_t cpu_end;
StringIdx text; StringIdx text;
uint32_t callstack;
// This must be last. All above is read/saved as-is. // This must be last. All above is read/saved as-is.
Vector<ZoneEvent*> child; Vector<ZoneEvent*> child;

View File

@ -1597,6 +1597,7 @@ void Worker::ProcessZoneBeginImpl( ZoneEvent* zone, const QueueZoneBegin& ev )
zone->srcloc = ShrinkSourceLocation( ev.srcloc ); zone->srcloc = ShrinkSourceLocation( ev.srcloc );
assert( ev.cpu == 0xFFFFFFFF || ev.cpu <= std::numeric_limits<int8_t>::max() ); assert( ev.cpu == 0xFFFFFFFF || ev.cpu <= std::numeric_limits<int8_t>::max() );
zone->cpu_start = ev.cpu == 0xFFFFFFFF ? -1 : (int8_t)ev.cpu; zone->cpu_start = ev.cpu == 0xFFFFFFFF ? -1 : (int8_t)ev.cpu;
zone->callstack = 0;
m_data.lastTime = std::max( m_data.lastTime, zone->start ); m_data.lastTime = std::max( m_data.lastTime, zone->start );
@ -1631,6 +1632,7 @@ void Worker::ProcessZoneBeginAllocSrcLoc( const QueueZoneBegin& ev )
zone->srcloc = it->second; zone->srcloc = it->second;
assert( ev.cpu == 0xFFFFFFFF || ev.cpu <= std::numeric_limits<int8_t>::max() ); assert( ev.cpu == 0xFFFFFFFF || ev.cpu <= std::numeric_limits<int8_t>::max() );
zone->cpu_start = ev.cpu == 0xFFFFFFFF ? -1 : (int8_t)ev.cpu; zone->cpu_start = ev.cpu == 0xFFFFFFFF ? -1 : (int8_t)ev.cpu;
zone->callstack = 0;
m_data.lastTime = std::max( m_data.lastTime, zone->start ); m_data.lastTime = std::max( m_data.lastTime, zone->start );