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
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
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;

View File

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