Add direct zone end getter.

This commit is contained in:
Bartosz Taudul 2018-03-18 02:53:00 +01:00
parent 746df21ad9
commit e6b3f373c5
2 changed files with 17 additions and 0 deletions

View File

@ -308,6 +308,16 @@ int64_t Worker::GetZoneEnd( const GpuEvent& ev ) const
} }
} }
int64_t Worker::GetZoneEndDirect( const ZoneEvent& ev ) const
{
return ev.end != -1 ? ev.end : ev.start;
}
int64_t Worker::GetZoneEndDirect( const GpuEvent& ev ) const
{
return ev.gpuEnd != -1 ? ev.gpuEnd : ev.gpuStart;
}
const char* Worker::GetString( uint64_t ptr ) const const char* Worker::GetString( uint64_t ptr ) const
{ {
const auto it = m_data.strings.find( ptr ); const auto it = m_data.strings.find( ptr );

View File

@ -94,8 +94,15 @@ public:
const Vector<PlotData*>& GetPlots() const { return m_data.plots; } const Vector<PlotData*>& GetPlots() const { return m_data.plots; }
const Vector<ThreadData*>& GetThreadData() const { return m_data.threads; } const Vector<ThreadData*>& GetThreadData() const { return m_data.threads; }
// Some zones may have incomplete timing data (only start time is available, end hasn't arrived yet).
// 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 ) const; int64_t GetZoneEnd( const ZoneEvent& ev ) const;
int64_t GetZoneEnd( const GpuEvent& ev ) const; int64_t GetZoneEnd( const GpuEvent& ev ) const;
int64_t GetZoneEndDirect( const ZoneEvent& ev ) const;
int64_t GetZoneEndDirect( const GpuEvent& ev ) const;
const char* GetString( uint64_t ptr ) const; const char* GetString( uint64_t ptr ) const;
const char* GetString( const StringRef& ref ) const; const char* GetString( const StringRef& ref ) const;
const char* GetString( const StringIdx& idx ) const; const char* GetString( const StringIdx& idx ) const;