Add context switch accessor.

This commit is contained in:
Bartosz Taudul 2019-08-13 00:20:56 +02:00
parent 419f74280d
commit 0b03fed61c
2 changed files with 14 additions and 0 deletions

View File

@ -1246,6 +1246,19 @@ uint64_t Worker::GetPlotCount() const
return cnt;
}
const ContextSwitch* const Worker::GetContextSwitchData( uint64_t thread ) const
{
auto it = m_data.ctxSwitch.find( thread );
if( it != m_data.ctxSwitch.end() )
{
return it->second;
}
else
{
return nullptr;
}
}
size_t Worker::GetFullFrameCount( const FrameData& fd ) const
{
const auto sz = fd.frames.size();

View File

@ -274,6 +274,7 @@ public:
uint64_t GetFrameOffset() const { return m_data.frameOffset; }
const FrameData* GetFramesBase() const { return m_data.framesBase; }
const Vector<FrameData*>& GetFrames() const { return m_data.frames.Data(); }
const ContextSwitch* const GetContextSwitchData( uint64_t thread ) const;
int64_t GetFrameTime( const FrameData& fd, size_t idx ) const;
int64_t GetFrameBegin( const FrameData& fd, size_t idx ) const;