From 2f3ee594f0c9cb42c7b1180bdcbf4fe3553901e9 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 20 Jun 2021 00:50:14 +0200 Subject: [PATCH] Use square root to make slow branches and cache less spiky. --- server/TracySourceView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index fd7a4c1f..55637eec 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -4026,10 +4026,10 @@ void SourceView::GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, un case CostType::Retirements: stat = CountHwSamples( hw->retired, view.m_statRange ); break; case CostType::BranchesTaken: stat = CountHwSamples( hw->branchRetired, view.m_statRange ); break; case CostType::BranchMiss: stat = CountHwSamples( hw->branchMiss, view.m_statRange ); break; - case CostType::SlowBranches: stat = CountHwSamples( hw->branchMiss, view.m_statRange ) * CountHwSamples( hw->branchRetired, view.m_statRange ); break; + case CostType::SlowBranches: stat = sqrt( CountHwSamples( hw->branchMiss, view.m_statRange ) * CountHwSamples( hw->branchRetired, view.m_statRange ) ); break; case CostType::CacheAccess: stat = CountHwSamples( hw->cacheRef, view.m_statRange ); break; case CostType::CacheMiss: stat = CountHwSamples( hw->cacheMiss, view.m_statRange ); break; - case CostType::SlowCache: stat = CountHwSamples( hw->cacheMiss, view.m_statRange ) * CountHwSamples( hw->cacheRef, view.m_statRange ); break; + case CostType::SlowCache: stat = sqrt( CountHwSamples( hw->cacheMiss, view.m_statRange ) * CountHwSamples( hw->cacheRef, view.m_statRange ) ); break; default: assert( false ); return; } } @@ -4041,10 +4041,10 @@ void SourceView::GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, un case CostType::Retirements: stat = hw->retired.size(); break; case CostType::BranchesTaken: stat = hw->branchRetired.size(); break; case CostType::BranchMiss: stat = hw->branchMiss.size(); break; - case CostType::SlowBranches: stat = hw->branchMiss.size() * hw->branchRetired.size(); break; + case CostType::SlowBranches: stat = sqrt( hw->branchMiss.size() * hw->branchRetired.size() ); break; case CostType::CacheAccess: stat = hw->cacheRef.size(); break; case CostType::CacheMiss: stat = hw->cacheMiss.size(); break; - case CostType::SlowCache: stat = hw->cacheMiss.size() * hw->cacheRef.size(); break; + case CostType::SlowCache: stat = sqrt( hw->cacheMiss.size() * hw->cacheRef.size() ); break; default: assert( false ); return; } }