From 0e0692b7f7bf626427d1e4207acaa11aeba107fa Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 20 Jun 2021 16:01:19 +0200 Subject: [PATCH] Don't display hw samples as time in selected lines summary. --- server/TracySourceView.cpp | 70 +++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 285546eb..2f128cbd 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -1936,24 +1936,31 @@ void SourceView::RenderSymbolSourceView( const AddrStat& iptotal, const unordere ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); - if( m_childCalls ) + if( m_cost == CostType::SampleCount ) { - TextFocused( "Time:", TimeToString( ( count.local + count.ext ) * worker.GetSamplingPeriod() ) ); + if( m_childCalls ) + { + TextFocused( "Time:", TimeToString( ( count.local + count.ext ) * worker.GetSamplingPeriod() ) ); + } + else + { + TextFocused( "Time:", TimeToString( count.local * worker.GetSamplingPeriod() ) ); + } + ImGui::SameLine(); + ImGui::Spacing(); + ImGui::SameLine(); + if( m_childCalls ) + { + TextFocused( "Sample count:", RealToString( count.local + count.ext ) ); + } + else + { + TextFocused( "Sample count:", RealToString( count.local ) ); + } } else { - TextFocused( "Time:", TimeToString( count.local * worker.GetSamplingPeriod() ) ); - } - ImGui::SameLine(); - ImGui::Spacing(); - ImGui::SameLine(); - if( m_childCalls ) - { - TextFocused( "Sample count:", RealToString( count.local + count.ext ) ); - } - else - { - TextFocused( "Sample count:", RealToString( count.local ) ); + TextFocused( "Events:", RealToString( count.local ) ); } ImGui::SameLine(); ImGui::Spacing(); @@ -2537,24 +2544,31 @@ uint64_t SourceView::RenderSymbolAsmView( const AddrStat& iptotal, const unorder ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); - if( m_childCalls ) + if( m_cost == CostType::SampleCount ) { - TextFocused( "Time:", TimeToString( ( count.local + count.ext ) * worker.GetSamplingPeriod() ) ); + if( m_childCalls ) + { + TextFocused( "Time:", TimeToString( ( count.local + count.ext ) * worker.GetSamplingPeriod() ) ); + } + else + { + TextFocused( "Time:", TimeToString( count.local * worker.GetSamplingPeriod() ) ); + } + ImGui::SameLine(); + ImGui::Spacing(); + ImGui::SameLine(); + if( m_childCalls ) + { + TextFocused( "Sample count:", RealToString( count.local + count.ext ) ); + } + else + { + TextFocused( "Sample count:", RealToString( count.local ) ); + } } else { - TextFocused( "Time:", TimeToString( count.local * worker.GetSamplingPeriod() ) ); - } - ImGui::SameLine(); - ImGui::Spacing(); - ImGui::SameLine(); - if( m_childCalls ) - { - TextFocused( "Sample count:", RealToString( count.local + count.ext ) ); - } - else - { - TextFocused( "Sample count:", RealToString( count.local ) ); + TextFocused( "Events:", RealToString( count.local ) ); } ImGui::SameLine(); ImGui::Spacing();