From 0d8b2b6252f7c2ebf105b20fbb6938b76683e2d3 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 8 Sep 2024 15:41:44 +0200 Subject: [PATCH] Adapt frame graph tooltip to look more like zone tooltip. --- .../src/profiler/TracyView_FlameGraph.cpp | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/profiler/src/profiler/TracyView_FlameGraph.cpp b/profiler/src/profiler/TracyView_FlameGraph.cpp index 7ac17f83..b6c10f34 100644 --- a/profiler/src/profiler/TracyView_FlameGraph.cpp +++ b/profiler/src/profiler/TracyView_FlameGraph.cpp @@ -163,9 +163,25 @@ void View::DrawFlameGraphItem( const FlameGraphItem& item, FlameGraphContext& ct for( auto& v : item.children ) self -= v.time; ImGui::BeginTooltip(); - TextFocused( "Name:", name ); - TextFocused( "Time:", TimeToString( item.time ) ); - if( !item.children.empty() ) TextFocused( "Self time:", TimeToString( self ) ); + if( srcloc.name.active ) + { + ImGui::TextUnformatted( m_worker.GetString( srcloc.name ) ); + } + ImGui::TextUnformatted( m_worker.GetString( srcloc.function ) ); + ImGui::Separator(); + SmallColorBox( GetSrcLocColor( srcloc, 0 ) ); + ImGui::SameLine(); + ImGui::TextUnformatted( LocationToString( m_worker.GetString( srcloc.file ), srcloc.line ) ); + ImGui::Separator(); + TextFocused( "Execution time:", TimeToString( item.time ) ); + if( !item.children.empty() ) + { + TextFocused( "Self time:", TimeToString( self ) ); + char buf[64]; + PrintStringPercent( buf, 100.f * self / item.time ); + ImGui::SameLine(); + TextDisabledUnformatted( buf ); + } ImGui::EndTooltip(); if( ImGui::IsMouseClicked( 0 ) )