diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2019-08-16 19:38:44 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2019-08-16 19:39:03 +0300 |
commit | 56e6795c76b90950e8d8bb2fb2d2f7e550f8b07b (patch) | |
tree | 50e44b241bc607b022ed8a67fc55145dd94a3575 /server/TracyView.cpp | |
parent | 7e81f3250e5b1f240cab6968e28148b794fe46a2 (diff) |
Add per-cpu context switch tooltips.
Diffstat (limited to 'server/TracyView.cpp')
-rw-r--r-- | server/TracyView.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/server/TracyView.cpp b/server/TracyView.cpp index e0021eb3..453ee3c1 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3948,6 +3948,26 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, nextTime = nend + nspx; } DrawZigZag( draw, wpos + ImVec2( 0, offset + sty/2 ), std::max( px0, -10.0 ), std::min( std::max( px1, px0+MinVisSize ), double( w + 10 ) ), sty/4, 0xFF888888 ); + + if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px0, offset-1 ), wpos + ImVec2( std::max( px1, px0+MinVisSize ), offset + sty - 1 ) ) ) + { + ImGui::PopFont(); + ImGui::BeginTooltip(); + TextFocused( "CPU:", RealToString( i, true ) ); + TextFocused( "Context switch regions:", RealToString( num, true ) ); + ImGui::Separator(); + TextFocused( "Start time:", TimeToString( start ) ); + TextFocused( "End time:", TimeToString( rend ) ); + TextFocused( "Activity time:", TimeToString( rend - start ) ); + ImGui::EndTooltip(); + ImGui::PushFont( m_smallFont ); + + if( ImGui::IsMouseClicked( 2 ) ) + { + ZoomToRange( start, rend ); + } + } + } else { @@ -3988,6 +4008,34 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover, ImGui::PopClipRect(); } } + if( hover && ImGui::IsMouseHoveringRect( wpos + ImVec2( px0, offset-1 ), wpos + ImVec2( px1, offset + sty - 1 ) ) ) + { + ImGui::PopFont(); + ImGui::BeginTooltip(); + TextFocused( "CPU:", RealToString( i, true ) ); + if( local ) + { + TextFocused( "Program:", m_worker.GetCaptureProgram().c_str() ); + ImGui::SameLine(); + TextDisabledUnformatted( "(profiled program)" ); + TextFocused( "Thread:", m_worker.GetThreadString( thread ) ); + } + else + { + TextFocused( "Program:", "<external>" ); + } + ImGui::Separator(); + TextFocused( "Start time:", TimeToString( start ) ); + TextFocused( "End time:", TimeToString( end ) ); + TextFocused( "Activity time:", TimeToString( end - start ) ); + ImGui::EndTooltip(); + ImGui::PushFont( m_smallFont ); + + if( ImGui::IsMouseClicked( 2 ) ) + { + ZoomToRange( start, end ); + } + } ++it; } } |