From b4c1313a2e46b5b671ac2a02fdc26688e4b7ddaa Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 15 Jul 2021 01:44:33 +0200 Subject: [PATCH] Make hw stats cost a parameter. --- server/TracySourceView.cpp | 8 ++++---- server/TracySourceView.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index 2f128cbd..b7b50fd2 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -1228,7 +1228,7 @@ void SourceView::RenderSymbolView( Worker& worker, View& view ) } else { - GatherIpHwStats( iptotalSrc, iptotalAsm, ipcountSrc, ipcountAsm, ipmaxSrc, ipmaxAsm, worker, limitView, view ); + GatherIpHwStats( iptotalSrc, iptotalAsm, ipcountSrc, ipcountAsm, ipmaxSrc, ipmaxAsm, worker, limitView, view, m_cost ); } if( !m_calcInlineStats ) { @@ -4032,7 +4032,7 @@ void SourceView::SelectAsmLinesHover( uint32_t file, uint32_t line, const Worker } } -void SourceView::GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, unordered_flat_map& ipcountSrc, unordered_flat_map& ipcountAsm, AddrStat& ipmaxSrc, AddrStat& ipmaxAsm, Worker& worker, bool limitView, const View& view ) +void SourceView::GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, unordered_flat_map& ipcountSrc, unordered_flat_map& ipcountAsm, AddrStat& ipmaxSrc, AddrStat& ipmaxAsm, Worker& worker, bool limitView, const View& view, CostType cost ) { auto filename = m_source.filename(); for( auto& v : m_asm ) @@ -4044,7 +4044,7 @@ void SourceView::GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, un uint64_t stat; if( view.m_statRange.active ) { - switch( m_cost ) + switch( cost ) { case CostType::Cycles: stat = CountHwSamples( hw->cycles, view.m_statRange ); break; case CostType::Retirements: stat = CountHwSamples( hw->retired, view.m_statRange ); break; @@ -4059,7 +4059,7 @@ void SourceView::GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, un } else { - switch( m_cost ) + switch( cost ) { case CostType::Cycles: stat = hw->cycles.size(); break; case CostType::Retirements: stat = hw->retired.size(); break; diff --git a/server/TracySourceView.hpp b/server/TracySourceView.hpp index 04cb72f0..12700948 100644 --- a/server/TracySourceView.hpp +++ b/server/TracySourceView.hpp @@ -160,7 +160,7 @@ private: void SelectAsmLines( uint32_t file, uint32_t line, const Worker& worker, bool changeAsmLine = true, uint64_t targetAddr = 0 ); void SelectAsmLinesHover( uint32_t file, uint32_t line, const Worker& worker ); - void GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, unordered_flat_map& ipcountSrc, unordered_flat_map& ipcountAsm, AddrStat& ipmaxSrc, AddrStat& ipmaxAsm, Worker& worker, bool limitView, const View& view ); + void GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, unordered_flat_map& ipcountSrc, unordered_flat_map& ipcountAsm, AddrStat& ipmaxSrc, AddrStat& ipmaxAsm, Worker& worker, bool limitView, const View& view, CostType cost ); void GatherIpStats( uint64_t baseAddr, AddrStat& iptotalSrc, AddrStat& iptotalAsm, unordered_flat_map& ipcountSrc, unordered_flat_map& ipcountAsm, AddrStat& ipmaxSrc, AddrStat& ipmaxAsm, const Worker& worker, bool limitView, const View& view ); void GatherAdditionalIpStats( uint64_t baseAddr, AddrStat& iptotalSrc, AddrStat& iptotalAsm, unordered_flat_map& ipcountSrc, unordered_flat_map& ipcountAsm, AddrStat& ipmaxSrc, AddrStat& ipmaxAsm, const Worker& worker, bool limitView, const View& view ); uint32_t CountAsmIpStats( uint64_t baseAddr, const Worker& worker, bool limitView, const View& view );