From 526d0cd22ab6c067cea271dd9be0ffd8f83f6f45 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 18 Apr 2021 19:10:39 +0200 Subject: [PATCH] Display child time and samples in symbol stats. --- server/TracySourceView.cpp | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index c1dd5fd5..607673d9 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -1142,11 +1142,39 @@ void SourceView::RenderSymbolView( const Worker& worker, View& view ) ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); - TextFocused( ICON_FA_STOPWATCH " Time:", TimeToString( iptotalAsm.local * worker.GetSamplingPeriod() ) ); + if( m_childCalls ) + { + TextFocused( ICON_FA_STOPWATCH " Time:", TimeToString( ( iptotalAsm.local + iptotalAsm.ext ) * worker.GetSamplingPeriod() ) ); + } + else + { + TextFocused( ICON_FA_STOPWATCH " Time:", TimeToString( iptotalAsm.local * worker.GetSamplingPeriod() ) ); + } + if( ImGui::IsItemHovered() ) + { + ImGui::BeginTooltip(); + TextFocused( "Local time:", TimeToString( iptotalAsm.local * worker.GetSamplingPeriod() ) ); + TextFocused( "Child time:", TimeToString( iptotalAsm.ext * worker.GetSamplingPeriod() ) ); + ImGui::EndTooltip(); + } ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine(); - TextFocused( ICON_FA_EYE_DROPPER " Samples:", RealToString( iptotalAsm.local ) ); + if( m_childCalls ) + { + TextFocused( ICON_FA_EYE_DROPPER " Samples:", RealToString( iptotalAsm.local + iptotalAsm.ext ) ); + } + else + { + TextFocused( ICON_FA_EYE_DROPPER " Samples:", RealToString( iptotalAsm.local ) ); + } + if( ImGui::IsItemHovered() ) + { + ImGui::BeginTooltip(); + TextFocused( "Local samples:", RealToString( iptotalAsm.local ) ); + TextFocused( "Child samples:", RealToString( iptotalAsm.ext ) ); + ImGui::EndTooltip(); + } ImGui::SameLine(); ImGui::Spacing(); ImGui::SameLine();