From 1cd86cb30fc5d2b35e3349c988ae8cf381eab170 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 29 Sep 2017 22:13:22 +0200 Subject: [PATCH] Display exclusive zone time. --- server/TracyView.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index c1e80349..d22427b3 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1272,6 +1272,7 @@ void View::DrawZoneInfoWindow() bool show = true; ImGui::Begin( "Zone info", &show, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_ShowBorders ); + if( ImGui::Button( "Zoom to zone" ) ) { ZoomToZone( ev ); @@ -1296,9 +1297,23 @@ void View::DrawZoneInfoWindow() ImGui::Separator(); const auto end = GetZoneEnd( ev ); + const auto ztime = end - ev.start; ImGui::Text( "Time from start of program: %s", TimeToString( ev.start - m_frames[0] ) ); - ImGui::Text( "Execution time: %s", TimeToString( end - ev.start ) ); - ImGui::Text( "Without profiling: %s", TimeToString( end - ev.start - m_delay * dmul ) ); + ImGui::Text( "Execution time: %s", TimeToString( ztime ) ); + ImGui::Text( "Without profiling: %s", TimeToString( ztime - m_delay * dmul ) ); + + ImGui::Separator(); + + uint64_t ctime = 0; + for( auto& v : ev.child ) + { + const auto cend = GetZoneEnd( *v ); + ctime += cend - v->start; + } + + ImGui::Text( "Child zones: %" PRIu64, ev.child.size() ); + ImGui::Text( "Exclusive zone time: %s (%.2f%%)", TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 ); + ImGui::End(); if( !show ) m_zoneInfoWindow = nullptr;