Make hw stats cost a parameter.

This commit is contained in:
Bartosz Taudul
2021-07-15 01:44:33 +02:00
parent 50f7deb1a3
commit b4c1313a2e
2 changed files with 5 additions and 5 deletions

View File

@@ -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<uint64_t, AddrStat>& ipcountSrc, unordered_flat_map<uint64_t, AddrStat>& ipcountAsm, AddrStat& ipmaxSrc, AddrStat& ipmaxAsm, Worker& worker, bool limitView, const View& view )
void SourceView::GatherIpHwStats( AddrStat& iptotalSrc, AddrStat& iptotalAsm, unordered_flat_map<uint64_t, AddrStat>& ipcountSrc, unordered_flat_map<uint64_t, AddrStat>& 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;