From 61828070c564c2504004b04a5c725a08760812b7 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 10 Apr 2020 23:03:47 +0200 Subject: [PATCH] Display tooltip for sample percentage. --- server/TracySourceView.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index e8f16a7a..03306704 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -961,7 +961,7 @@ uint64_t SourceView::RenderSymbolAsmView( uint32_t iptotal, unordered_flat_mapGetSamplingPeriod() ) ); + TextFocused( "Sample count:", RealToString( ipcnt ) ); + ImGui::EndTooltip(); + if( m_font ) ImGui::PushFont( m_font ); + } } ImGui::SameLine( 0, ty ); } @@ -1103,7 +1112,16 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip } else { - PrintPercentage( 100.f * ipcnt / iptotal ); + if( PrintPercentage( 100.f * ipcnt / iptotal ) ) + { + if( m_font ) ImGui::PopFont(); + ImGui::BeginTooltip(); + TextFocused( "Time:", TimeToString( ipcnt * worker.GetSamplingPeriod() ) ); + TextFocused( "Sample count:", RealToString( ipcnt ) ); + ImGui::EndTooltip(); + if( m_font ) ImGui::PushFont( m_font ); + } + } ImGui::SameLine( 0, ty ); }