Display cache and branch miss rates.

This commit is contained in:
Bartosz Taudul 2021-05-20 02:26:02 +02:00
parent 227a8d1aee
commit 9b4716c49e
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -2636,6 +2636,22 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
} }
if( hw->cycles ) TextFocused( "Cycles:", RealToString( hw->cycles ) ); if( hw->cycles ) TextFocused( "Cycles:", RealToString( hw->cycles ) );
if( hw->retired ) TextFocused( "Retirements:", RealToString( hw->retired ) ); if( hw->retired ) TextFocused( "Retirements:", RealToString( hw->retired ) );
if( hw->cacheRef && hw->cacheMiss )
{
TextDisabledUnformatted( "Cache miss rate:" );
ImGui::SameLine();
PrintPercentage( float( 100 * hw->cacheMiss ) / hw->cacheRef );
}
if( hw->cacheRef ) TextFocused( "Cache references:", RealToString( hw->cacheRef ) );
if( hw->cacheMiss ) TextFocused( "Cache misses:", RealToString( hw->cacheMiss ) );
if( hw->branchRetired && hw->branchMiss )
{
TextDisabledUnformatted( "Branch mispredictions rate:" );
ImGui::SameLine();
PrintPercentage( float( 100 * hw->branchMiss ) / hw->branchRetired );
}
if( hw->branchRetired ) TextFocused( "Retired branches:", RealToString( hw->branchRetired ) );
if( hw->branchMiss ) TextFocused( "Branch mispredictions:", RealToString( hw->branchMiss ) );
} }
const auto& stats = *worker.GetSymbolStats( symAddrParents ); const auto& stats = *worker.GetSymbolStats( symAddrParents );
if( !stats.parents.empty() ) if( !stats.parents.empty() )