From 4970c48c51a2a10620049ea5703973df17018df7 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 18 Apr 2021 20:27:47 +0200 Subject: [PATCH] Don't shadow variables. --- server/TracySourceView.cpp | 12 ++++++------ server/TracySourceView.hpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index d7dda3ae..73bf9716 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -3281,13 +3281,13 @@ void SourceView::SelectAsmLinesHover( uint32_t file, uint32_t line, const Worker } } -void SourceView::GatherIpStats( uint64_t addr, 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 SourceView::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 ) { const auto slzReady = worker.AreSourceLocationZonesReady(); auto filename = m_source.filename(); if( limitView ) { - auto vec = worker.GetSamplesForSymbol( addr ); + auto vec = worker.GetSamplesForSymbol( baseAddr ); if( !vec ) return; auto it = std::lower_bound( vec->begin(), vec->end(), view.m_statRange.min, [] ( const auto& lhs, const auto& rhs ) { return lhs.time.Val() < rhs; } ); if( it == vec->end() ) return; @@ -3343,7 +3343,7 @@ void SourceView::GatherIpStats( uint64_t addr, AddrStat& iptotalSrc, AddrStat& i } else { - auto ipmap = worker.GetSymbolInstructionPointers( addr ); + auto ipmap = worker.GetSymbolInstructionPointers( baseAddr ); if( !ipmap ) return; for( auto& ip : *ipmap ) { @@ -3394,11 +3394,11 @@ void SourceView::GatherIpStats( uint64_t addr, AddrStat& iptotalSrc, AddrStat& i } } -uint32_t SourceView::CountAsmIpStats( uint64_t addr, const Worker& worker, bool limitView, const View& view ) +uint32_t SourceView::CountAsmIpStats( uint64_t baseAddr, const Worker& worker, bool limitView, const View& view ) { if( limitView ) { - auto vec = worker.GetSamplesForSymbol( addr ); + auto vec = worker.GetSamplesForSymbol( baseAddr ); if( !vec ) return 0; auto it = std::lower_bound( vec->begin(), vec->end(), view.m_statRange.min, [] ( const auto& lhs, const auto& rhs ) { return lhs.time.Val() < rhs; } ); if( it == vec->end() ) return 0; @@ -3408,7 +3408,7 @@ uint32_t SourceView::CountAsmIpStats( uint64_t addr, const Worker& worker, bool else { uint32_t cnt = 0; - auto ipmap = worker.GetSymbolInstructionPointers( addr ); + auto ipmap = worker.GetSymbolInstructionPointers( baseAddr ); if( !ipmap ) return 0; for( auto& ip : *ipmap ) cnt += ip.second; return cnt; diff --git a/server/TracySourceView.hpp b/server/TracySourceView.hpp index 078f8831..dc68b27e 100644 --- a/server/TracySourceView.hpp +++ b/server/TracySourceView.hpp @@ -146,8 +146,8 @@ 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 GatherIpStats( uint64_t addr, 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 addr, const Worker& worker, bool limitView, const View& view ); + 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 ); + uint32_t CountAsmIpStats( uint64_t baseAddr, const Worker& worker, bool limitView, const View& view ); void SelectMicroArchitecture( const char* moniker );