Disable samples limit range until background job is done.

This commit is contained in:
Bartosz Taudul 2020-08-07 14:53:39 +02:00
parent 54651f9f6d
commit 87e7cba289
3 changed files with 31 additions and 9 deletions

View File

@ -11869,20 +11869,39 @@ void View::DrawStatistics()
ImGui::SameLine();
ImGui::Spacing();
ImGui::SameLine();
if( ImGui::Checkbox( "Limit range", &m_statRange.active ) )
if( m_statMode == 1 && !m_worker.AreSymbolSamplesReady() )
{
if( m_statRange.active && m_statRange.min == 0 && m_statRange.max == 0 )
m_statRange.active = false;
bool val = false;
ImGui::PushItemFlag( ImGuiItemFlags_Disabled, true );
ImGui::PushStyleVar( ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f );
ImGui::Checkbox( "Limit range", &val );
ImGui::PopItemFlag();
ImGui::PopStyleVar();
if( ImGui::IsItemHovered() )
{
m_statRange.min = m_vd.zvStart;
m_statRange.max = m_vd.zvEnd;
ImGui::BeginTooltip();
ImGui::TextUnformatted( "Waiting for background tasks to finish" );
ImGui::EndTooltip();
}
}
if( m_statRange.active )
else
{
ImGui::SameLine();
TextColoredUnformatted( 0xFF00FFFF, ICON_FA_EXCLAMATION_TRIANGLE );
ImGui::SameLine();
ToggleButton( ICON_FA_RULER " Limits", m_showRanges );
if( ImGui::Checkbox( "Limit range", &m_statRange.active ) )
{
if( m_statRange.active && m_statRange.min == 0 && m_statRange.max == 0 )
{
m_statRange.min = m_vd.zvStart;
m_statRange.max = m_vd.zvEnd;
}
}
if( m_statRange.active )
{
ImGui::SameLine();
TextColoredUnformatted( 0xFF00FFFF, ICON_FA_EXCLAMATION_TRIANGLE );
ImGui::SameLine();
ToggleButton( ICON_FA_RULER " Limits", m_showRanges );
}
}
ImGui::Separator();

View File

@ -264,6 +264,7 @@ Worker::Worker( const char* addr, int port )
m_data.callstackSamplesReady = true;
m_data.ghostZonesReady = true;
m_data.ctxUsageReady = true;
m_data.symbolSamplesReady = true;
#endif
m_thread = std::thread( [this] { SetThreadName( "Tracy Worker" ); Exec(); } );

View File

@ -292,6 +292,7 @@ private:
bool callstackSamplesReady = false;
bool ghostZonesReady = false;
bool ghostZonesPostponed = false;
bool symbolSamplesReady = false;
#endif
unordered_flat_map<uint32_t, LockMap*> lockMap;
@ -552,6 +553,7 @@ public:
const unordered_flat_map<CallstackFrameId, uint32_t, CallstackFrameIdHash, CallstackFrameIdCompare>* GetSymbolInstructionPointers( uint64_t symAddr ) const;
bool AreCallstackSamplesReady() const { return m_data.callstackSamplesReady; }
bool AreGhostZonesReady() const { return m_data.ghostZonesReady; }
bool AreSymbolSamplesReady() const { return m_data.symbolSamplesReady; }
#endif
tracy_force_inline uint16_t CompressThread( uint64_t thread ) { return m_data.localThreadCompress.CompressThread( thread ); }