diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 76153229..e73088e4 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -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 ); diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 7c0e6d16..1a2d568a 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -665,6 +665,9 @@ private: const ContextSwitch* const GetContextSwitchDataImpl( uint64_t thread ); tracy_force_inline Vector>& GetZoneChildrenMutable( int32_t idx ) { return m_data.zoneChildren[idx]; } +#ifndef TRACY_NO_STATISTICS + tracy_force_inline Vector& GetGhostChildrenMutable( int32_t idx ) { return m_data.ghostChildren[idx]; } +#endif #ifndef TRACY_NO_STATISTICS void ReconstructContextSwitchUsage();