Restrict hardware samples to inline function context.

This commit is contained in:
Bartosz Taudul 2021-06-19 20:50:06 +02:00
parent 6cc844abee
commit 2e3241ba54
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -2567,30 +2567,33 @@ void SourceView::RenderLine( const Tokenizer::Line& line, int lineNum, const Add
{ {
if( addr >= m_baseAddr && addr < m_baseAddr + m_codeLen ) if( addr >= m_baseAddr && addr < m_baseAddr + m_codeLen )
{ {
match++; if( !m_calcInlineStats || worker->GetInlineSymbolForAddress( addr ) == m_symAddr )
const auto hw = worker->GetHwSampleData( addr );
if( hw )
{ {
hasHwData = true; match++;
auto& statRange = view->m_statRange; const auto hw = worker->GetHwSampleData( addr );
if( statRange.active ) if( hw )
{ {
hw->sort(); hasHwData = true;
cycles += CountHwSamples( hw->cycles, statRange ); auto& statRange = view->m_statRange;
retired += CountHwSamples( hw->retired, statRange ); if( statRange.active )
cacheRef += CountHwSamples( hw->cacheRef, statRange ); {
cacheMiss += CountHwSamples( hw->cacheMiss, statRange ); hw->sort();
branchRetired += CountHwSamples( hw->branchRetired, statRange ); cycles += CountHwSamples( hw->cycles, statRange );
branchMiss += CountHwSamples( hw->branchMiss, statRange ); retired += CountHwSamples( hw->retired, statRange );
} cacheRef += CountHwSamples( hw->cacheRef, statRange );
else cacheMiss += CountHwSamples( hw->cacheMiss, statRange );
{ branchRetired += CountHwSamples( hw->branchRetired, statRange );
cycles += hw->cycles.size(); branchMiss += CountHwSamples( hw->branchMiss, statRange );
retired += hw->retired.size(); }
cacheRef += hw->cacheRef.size(); else
cacheMiss += hw->cacheMiss.size(); {
branchRetired += hw->branchRetired.size(); cycles += hw->cycles.size();
branchMiss += hw->branchMiss.size(); retired += hw->retired.size();
cacheRef += hw->cacheRef.size();
cacheMiss += hw->cacheMiss.size();
branchRetired += hw->branchRetired.size();
branchMiss += hw->branchMiss.size();
}
} }
} }
} }
@ -2830,7 +2833,7 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr
const auto hw = worker.GetHwSampleData( line.addr ); const auto hw = worker.GetHwSampleData( line.addr );
size_t cycles = 0, retired = 0, cacheRef = 0, cacheMiss = 0, branchRetired = 0, branchMiss = 0; size_t cycles = 0, retired = 0, cacheRef = 0, cacheMiss = 0, branchRetired = 0, branchMiss = 0;
if( hw ) if( hw && ( !m_calcInlineStats || worker.GetInlineSymbolForAddress( line.addr ) == m_symAddr ) )
{ {
if( view.m_statRange.active ) if( view.m_statRange.active )
{ {