Fix ghost children times.

This commit is contained in:
Bartosz Taudul 2020-03-18 02:20:21 +01:00
parent 1f4dbd1b2e
commit 92e2597192
2 changed files with 10 additions and 1 deletions

View File

@ -1800,7 +1800,13 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
else
{
gcnt++;
back.end.SetVal( time );
auto ptr = &back;
for(;;)
{
ptr->end.SetVal( time );
if( ptr->child < 0 ) break;
ptr = &GetGhostChildrenMutable( ptr->child ).back();
}
auto& zone = vec->push_next();
zone.start.SetVal( time );
zone.end.SetVal( time + m_samplingPeriod );

View File

@ -665,6 +665,9 @@ private:
const ContextSwitch* const GetContextSwitchDataImpl( uint64_t thread );
tracy_force_inline Vector<short_ptr<ZoneEvent>>& GetZoneChildrenMutable( int32_t idx ) { return m_data.zoneChildren[idx]; }
#ifndef TRACY_NO_STATISTICS
tracy_force_inline Vector<GhostZone>& GetGhostChildrenMutable( int32_t idx ) { return m_data.ghostChildren[idx]; }
#endif
#ifndef TRACY_NO_STATISTICS
void ReconstructContextSwitchUsage();