Add accessors.

This commit is contained in:
Bartosz Taudul 2019-08-18 01:51:02 +02:00
parent 103645c2fa
commit 62dbe522c5
2 changed files with 9 additions and 0 deletions

View File

@ -1653,6 +1653,13 @@ uint64_t Worker::GetContextSwitchPerCpuCount() const
return cnt;
}
uint64_t Worker::GetPidFromTid( uint64_t tid ) const
{
auto it = m_data.tidToPid.find( tid );
if( it == m_data.tidToPid.end() ) return 0;
return it->second;
}
const ContextSwitch* const Worker::GetContextSwitchDataImpl( uint64_t thread )
{
auto it = m_data.ctxSwitch.find( thread );

View File

@ -301,6 +301,8 @@ public:
return GetContextSwitchDataImpl( thread );
}
const CpuData* GetCpuData() const { return m_data.cpuData; }
uint64_t GetPidFromTid( uint64_t tid ) const;
const flat_hash_map<uint64_t, CpuThreadData, nohash<uint64_t>>& GetCpuThreadData() const { return m_data.cpuThreadData; }
int64_t GetFrameTime( const FrameData& fd, size_t idx ) const;
int64_t GetFrameBegin( const FrameData& fd, size_t idx ) const;