mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Force inline GetZoneEnd's fast exit path.
This commit is contained in:
parent
2e9d8f8215
commit
5019f7d2b4
@ -2313,12 +2313,12 @@ const uint64_t* Worker::GetInlineSymbolList( uint64_t sym, uint32_t len )
|
||||
return it;
|
||||
}
|
||||
|
||||
int64_t Worker::GetZoneEnd( const ZoneEvent& ev )
|
||||
int64_t Worker::GetZoneEndImpl( const ZoneEvent& ev )
|
||||
{
|
||||
assert( !ev.IsEndValid() );
|
||||
auto ptr = &ev;
|
||||
for(;;)
|
||||
{
|
||||
if( ptr->IsEndValid() ) return ptr->End();
|
||||
if( !ptr->HasChildren() ) return ptr->Start();
|
||||
auto& children = GetZoneChildren( ptr->Child() );
|
||||
if( children.is_magic() )
|
||||
@ -2330,15 +2330,16 @@ int64_t Worker::GetZoneEnd( const ZoneEvent& ev )
|
||||
{
|
||||
ptr = children.back();
|
||||
}
|
||||
if( ptr->IsEndValid() ) return ptr->End();
|
||||
}
|
||||
}
|
||||
|
||||
int64_t Worker::GetZoneEnd( const GpuEvent& ev )
|
||||
int64_t Worker::GetZoneEndImpl( const GpuEvent& ev )
|
||||
{
|
||||
assert( ev.GpuEnd() < 0 );
|
||||
auto ptr = &ev;
|
||||
for(;;)
|
||||
{
|
||||
if( ptr->GpuEnd() >= 0 ) return ptr->GpuEnd();
|
||||
if( ptr->Child() < 0 ) return ptr->GpuStart() >= 0 ? ptr->GpuStart() : m_data.lastTime;
|
||||
auto& children = GetGpuChildren( ptr->Child() );
|
||||
if( children.is_magic() )
|
||||
@ -2350,6 +2351,7 @@ int64_t Worker::GetZoneEnd( const GpuEvent& ev )
|
||||
{
|
||||
ptr = children.back();
|
||||
}
|
||||
if( ptr->GpuEnd() >= 0 ) return ptr->GpuEnd();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -562,8 +562,8 @@ public:
|
||||
// GetZoneEnd() will try to infer the end time by looking at child zones (parent zone can't end
|
||||
// before its children have ended).
|
||||
// GetZoneEndDirect() will only return zone's direct timing data, without looking at children.
|
||||
int64_t GetZoneEnd( const ZoneEvent& ev );
|
||||
int64_t GetZoneEnd( const GpuEvent& ev );
|
||||
tracy_force_inline int64_t GetZoneEnd( const ZoneEvent& ev ) { return ev.IsEndValid() ? ev.End() : GetZoneEndImpl( ev ); }
|
||||
tracy_force_inline int64_t GetZoneEnd( const GpuEvent& ev ) { return ev.GpuEnd() >= 0 ? ev.GpuEnd() : GetZoneEndImpl( ev ); }
|
||||
static tracy_force_inline int64_t GetZoneEndDirect( const ZoneEvent& ev ) { return ev.IsEndValid() ? ev.End() : ev.Start(); }
|
||||
static tracy_force_inline int64_t GetZoneEndDirect( const GpuEvent& ev ) { return ev.GpuEnd() >= 0 ? ev.GpuEnd() : ev.GpuStart(); }
|
||||
|
||||
@ -929,6 +929,9 @@ private:
|
||||
tracy_force_inline ZoneExtra& AllocZoneExtra( ZoneEvent& ev );
|
||||
tracy_force_inline ZoneExtra& RequestZoneExtra( ZoneEvent& ev );
|
||||
|
||||
int64_t GetZoneEndImpl( const ZoneEvent& ev );
|
||||
int64_t GetZoneEndImpl( const GpuEvent& ev );
|
||||
|
||||
void UpdateMbps( int64_t td );
|
||||
|
||||
int64_t ReadTimeline( FileRead& f, Vector<short_ptr<ZoneEvent>>& vec, uint32_t size, int64_t refTime, int32_t& childIdx );
|
||||
|
Loading…
Reference in New Issue
Block a user