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

Parent vector retrieval.

This commit is contained in:
Bartosz Taudul
2017-09-24 03:23:01 +02:00
parent 1005fa0c91
commit 6419cd5062
2 changed files with 21 additions and 0 deletions
+20
View File
@@ -486,6 +486,26 @@ uint64_t View::GetZoneEnd( const Event& ev ) const
}
}
Vector<Event*>& 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<Event*> empty;
return empty;
}
}
const char* View::TimeToString( uint64_t ns ) const
{
enum { Pool = 4 };