Display number of context switch regions.

This commit is contained in:
Bartosz Taudul 2019-08-13 00:29:09 +02:00
parent 0b03fed61c
commit 8c494eabbf
3 changed files with 12 additions and 0 deletions

View File

@ -8602,6 +8602,7 @@ void View::DrawInfo()
TextFocused( "Call stacks:", RealToString( m_worker.GetCallstackPayloadCount(), true ) ); TextFocused( "Call stacks:", RealToString( m_worker.GetCallstackPayloadCount(), true ) );
TextFocused( "Call stack frames:", RealToString( m_worker.GetCallstackFrameCount(), true ) ); TextFocused( "Call stack frames:", RealToString( m_worker.GetCallstackFrameCount(), true ) );
TextFocused( "Frame images:", RealToString( ficnt, true ) ); TextFocused( "Frame images:", RealToString( ficnt, true ) );
TextFocused( "Context switch regions:", RealToString( m_worker.GetContextSwitchCount(), true ) );
ImGui::TreePop(); ImGui::TreePop();
} }

View File

@ -1246,6 +1246,16 @@ uint64_t Worker::GetPlotCount() const
return cnt; return cnt;
} }
uint64_t Worker::GetContextSwitchCount() const
{
uint64_t cnt = 0;
for( auto& v : m_data.ctxSwitch )
{
cnt += v.second->v.size();
}
return cnt;
}
const ContextSwitch* const Worker::GetContextSwitchData( uint64_t thread ) const const ContextSwitch* const Worker::GetContextSwitchData( uint64_t thread ) const
{ {
auto it = m_data.ctxSwitch.find( thread ); auto it = m_data.ctxSwitch.find( thread );

View File

@ -267,6 +267,7 @@ public:
uint64_t GetZoneCount() const { return m_data.zonesCnt; } uint64_t GetZoneCount() const { return m_data.zonesCnt; }
uint64_t GetLockCount() const; uint64_t GetLockCount() const;
uint64_t GetPlotCount() const; uint64_t GetPlotCount() const;
uint64_t GetContextSwitchCount() const;
uint64_t GetSrcLocCount() const { return m_data.sourceLocationPayload.size() + m_data.sourceLocation.size(); } uint64_t GetSrcLocCount() const { return m_data.sourceLocationPayload.size() + m_data.sourceLocation.size(); }
uint64_t GetCallstackPayloadCount() const { return m_data.callstackPayload.size() - 1; } uint64_t GetCallstackPayloadCount() const { return m_data.callstackPayload.size() - 1; }
uint64_t GetCallstackFrameCount() const { return m_data.callstackFrameMap.size(); } uint64_t GetCallstackFrameCount() const { return m_data.callstackFrameMap.size(); }