Display count of per-cpu context switch data.

This commit is contained in:
Bartosz Taudul 2019-08-16 16:36:33 +02:00
parent a92034d59d
commit 8bc4258e29
3 changed files with 13 additions and 0 deletions

View File

@ -9154,6 +9154,8 @@ void View::DrawInfo()
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 ) ); TextFocused( "Context switch regions:", RealToString( m_worker.GetContextSwitchCount(), true ) );
ImGui::SameLine();
TextFocused( "+", RealToString( m_worker.GetContextSwitchPerCpuCount(), true ) );
ImGui::TreePop(); ImGui::TreePop();
} }

View File

@ -1553,6 +1553,16 @@ uint64_t Worker::GetContextSwitchCount() const
return cnt; return cnt;
} }
uint64_t Worker::GetContextSwitchPerCpuCount() const
{
uint64_t cnt = 0;
for( int i=0; i<256; i++ )
{
cnt += m_data.cpuData[i].cs.size();
}
return cnt;
}
const ContextSwitch* const Worker::GetContextSwitchDataImpl( uint64_t thread ) const ContextSwitch* const Worker::GetContextSwitchDataImpl( uint64_t thread )
{ {
auto it = m_data.ctxSwitch.find( thread ); auto it = m_data.ctxSwitch.find( thread );

View File

@ -281,6 +281,7 @@ public:
uint64_t GetLockCount() const; uint64_t GetLockCount() const;
uint64_t GetPlotCount() const; uint64_t GetPlotCount() const;
uint64_t GetContextSwitchCount() const; uint64_t GetContextSwitchCount() const;
uint64_t GetContextSwitchPerCpuCount() const;
bool HasContextSwitches() const { return !m_data.ctxSwitch.empty(); } bool HasContextSwitches() const { return !m_data.ctxSwitch.empty(); }
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; }