mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Parent vector retrieval.
This commit is contained in:
parent
1005fa0c91
commit
6419cd5062
@ -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
|
const char* View::TimeToString( uint64_t ns ) const
|
||||||
{
|
{
|
||||||
enum { Pool = 4 };
|
enum { Pool = 4 };
|
||||||
|
@ -66,6 +66,7 @@ private:
|
|||||||
uint64_t GetFrameEnd( size_t idx ) const;
|
uint64_t GetFrameEnd( size_t idx ) const;
|
||||||
uint64_t GetLastTime() const;
|
uint64_t GetLastTime() const;
|
||||||
uint64_t GetZoneEnd( const Event& ev ) const;
|
uint64_t GetZoneEnd( const Event& ev ) const;
|
||||||
|
Vector<Event*>& GetParentVector( const Event& ev );
|
||||||
const char* TimeToString( uint64_t ns ) const;
|
const char* TimeToString( uint64_t ns ) const;
|
||||||
const char* GetString( uint64_t ptr ) const;
|
const char* GetString( uint64_t ptr ) const;
|
||||||
const char* GetThreadString( uint64_t id ) const;
|
const char* GetThreadString( uint64_t id ) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user