From 24b5e167181475cdd3d76b6d66138887cf535a84 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 20 May 2021 01:37:59 +0200 Subject: [PATCH] Display hw sampling stats in tooltip. --- server/TracySourceView.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index a9d01b77..7d9ba337 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -2623,6 +2623,20 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr TextFocused( "Child time:", TimeToString( ipcnt.ext * worker.GetSamplingPeriod() ) ); TextFocused( "Child samples:", RealToString( ipcnt.ext ) ); } + const auto hw = worker.GetHwSampleData( line.addr ); + if( hw ) + { + ImGui::Separator(); + if( hw->cycles && hw->retired ) + { + char buf[32]; + auto end = PrintFloat( buf, buf+32, float( hw->retired ) / hw->cycles, 2 ); + *end = '\0'; + TextFocused( "IPC:", buf ); + } + if( hw->cycles ) TextFocused( "Cycles:", RealToString( hw->cycles ) ); + if( hw->retired ) TextFocused( "Retirements:", RealToString( hw->retired ) ); + } const auto& stats = *worker.GetSymbolStats( symAddrParents ); if( !stats.parents.empty() ) {