Context switch data may exists without CPU data.

This commit is contained in:
Bartosz Taudul 2021-11-06 20:22:08 +01:00
parent 904a444ea5
commit efeed326bf
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -5956,6 +5956,10 @@ const char* View::GetThreadContextData( uint64_t thread, bool& _local, bool& _un
int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, float yMin, float yMax )
{
auto cpuData = m_worker.GetCpuData();
const auto cpuCnt = m_worker.GetCpuDataCpuCount();
if( cpuCnt == 0 ) return offset;
const auto w = ImGui::GetWindowContentRegionWidth() - 1;
const auto ty = ImGui::GetFontSize();
const auto ostep = ty + 1;
@ -5997,10 +6001,6 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover,
if( showFull )
{
auto cpuData = m_worker.GetCpuData();
const auto cpuCnt = m_worker.GetCpuDataCpuCount();
assert( cpuCnt != 0 );
#ifdef TRACY_NO_STATISTICS
if( m_vd.drawCpuUsageGraph )
#else