mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-29 16:54:35 +00:00
Fix printing percentage.
This commit is contained in:
parent
bcb7b94272
commit
df50eb890f
@ -2638,17 +2638,19 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
|
|||||||
if( hw->retired ) TextFocused( "Retirements:", RealToString( hw->retired ) );
|
if( hw->retired ) TextFocused( "Retirements:", RealToString( hw->retired ) );
|
||||||
if( hw->cacheRef )
|
if( hw->cacheRef )
|
||||||
{
|
{
|
||||||
TextDisabledUnformatted( "Cache miss rate:" );
|
char buf[32];
|
||||||
ImGui::SameLine();
|
auto end = PrintFloat( buf, buf+32, float( 100 * hw->cacheMiss ) / hw->cacheRef, 2 );
|
||||||
PrintPercentage( float( 100 * hw->cacheMiss ) / hw->cacheRef );
|
memcpy( end, "%", 2 );
|
||||||
|
TextFocused( "Cache miss rate:", buf );
|
||||||
TextFocused( "Cache references:", RealToString( hw->cacheRef ) );
|
TextFocused( "Cache references:", RealToString( hw->cacheRef ) );
|
||||||
}
|
}
|
||||||
if( hw->cacheMiss ) TextFocused( "Cache misses:", RealToString( hw->cacheMiss ) );
|
if( hw->cacheMiss ) TextFocused( "Cache misses:", RealToString( hw->cacheMiss ) );
|
||||||
if( hw->branchRetired )
|
if( hw->branchRetired )
|
||||||
{
|
{
|
||||||
TextDisabledUnformatted( "Branch mispredictions rate:" );
|
char buf[32];
|
||||||
ImGui::SameLine();
|
auto end = PrintFloat( buf, buf+32, float( 100 * hw->branchMiss ) / hw->branchRetired, 2 );
|
||||||
PrintPercentage( float( 100 * hw->branchMiss ) / hw->branchRetired );
|
memcpy( end, "%", 2 );
|
||||||
|
TextFocused( "Branch mispredictions rate:", buf );
|
||||||
TextFocused( "Retired branches:", RealToString( hw->branchRetired ) );
|
TextFocused( "Retired branches:", RealToString( hw->branchRetired ) );
|
||||||
}
|
}
|
||||||
if( hw->branchMiss ) TextFocused( "Branch mispredictions:", RealToString( hw->branchMiss ) );
|
if( hw->branchMiss ) TextFocused( "Branch mispredictions:", RealToString( hw->branchMiss ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user