diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 0196e494..5e0d31e6 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -486,6 +486,26 @@ uint64_t View::GetZoneEnd( const Event& ev ) const } } +Vector& View::GetParentVector( const Event& ev ) +{ + // here be dragons + if( ev.parent ) + { + return ev.parent->child; + } + else + { + for( auto& t : m_threads ) + { + auto it = std::lower_bound( t.timeline.begin(), t.timeline.end(), ev.start, [] ( const auto& l, const auto& r ) { return l->start < r; } ); + if( it != t.timeline.end() && *it == &ev ) return t.timeline; + } + assert( false ); + static Vector empty; + return empty; + } +} + const char* View::TimeToString( uint64_t ns ) const { enum { Pool = 4 }; diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 0d43bc23..d3b51050 100755 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -66,6 +66,7 @@ private: uint64_t GetFrameEnd( size_t idx ) const; uint64_t GetLastTime() const; uint64_t GetZoneEnd( const Event& ev ) const; + Vector& GetParentVector( const Event& ev ); const char* TimeToString( uint64_t ns ) const; const char* GetString( uint64_t ptr ) const; const char* GetThreadString( uint64_t id ) const;