From d520f1cc485c95d043aa8df1b4014095f996d9bd Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 14 Aug 2019 17:59:28 +0200 Subject: [PATCH] Display zone running time in zone tooltip. --- server/TracyView.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index c50cfa66..067bf195 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -11082,6 +11082,22 @@ void View::ZoneTooltip( const ZoneEvent& ev ) ImGui::SameLine(); ImGui::TextDisabled( "(%.2f%%)", 100.f * selftime / ztime ); } + const auto ctx = m_worker.GetContextSwitchData( tid ); + if( ctx ) + { + int64_t time; + uint64_t cnt; + if( GetZoneRunningTime( ctx, ev, time, cnt ) ) + { + TextFocused( "Running state time:", TimeToString( time ) ); + if( ztime != 0 ) + { + ImGui::SameLine(); + ImGui::TextDisabled( "(%.2f%%)", 100.f * time / ztime ); + } + TextFocused( "Running state regions:", RealToString( cnt, true ) ); + } + } if( ev.text.active ) { ImGui::NewLine();