From c4bddf59e234279552f1754ec2c1057c736c6009 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 11 Apr 2020 18:21:46 +0200 Subject: [PATCH] Allow access to sampling data before instrumentation is ready. --- server/TracyView.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 630216a8..b4374302 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -11048,7 +11048,7 @@ void View::DrawStatistics() ImGui::TextWrapped( "Collection of statistical data is disabled in this build." ); ImGui::TextWrapped( "Rebuild without the TRACY_NO_STATISTICS macro to enable statistics view." ); #else - if( !m_worker.AreSourceLocationZonesReady() ) + if( !m_worker.AreSourceLocationZonesReady() && ( !m_worker.AreCallstackSamplesReady() || m_worker.GetCallstackSampleCount() == 0 ) ) { ImGui::TextWrapped( "Please wait, computing data..." ); DrawWaitingDots( s_time ); @@ -11082,6 +11082,16 @@ void View::DrawStatistics() if( m_statMode == 0 ) { + if( !m_worker.AreSourceLocationZonesReady() ) + { + ImGui::Spacing(); + ImGui::Separator(); + ImGui::TextWrapped( "Please wait, computing data..." ); + DrawWaitingDots( s_time ); + ImGui::End(); + return; + } + m_statisticsFilter.Draw( ICON_FA_FILTER, 200 ); ImGui::SameLine(); if( ImGui::Button( ICON_FA_BACKSPACE " Clear" ) )