mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Show branch impact if no retirement data available.
Some CPUs are only able to report branch miss data, but not branch retirement data.
This commit is contained in:
parent
d8ec98042a
commit
88a153504d
@ -4416,6 +4416,7 @@ void SourceView::GatherIpHwStats( AddrStatData& as, Worker& worker, const View&
|
||||
|
||||
void SourceView::CountHwStats( AddrStatData& as, Worker& worker, const View& view )
|
||||
{
|
||||
const auto hasBranchRetirement = worker.HasHwBranchRetirement();
|
||||
auto filename = m_source.filename();
|
||||
for( auto& v : m_asm )
|
||||
{
|
||||
@ -4426,12 +4427,26 @@ void SourceView::CountHwStats( AddrStatData& as, Worker& worker, const View& vie
|
||||
uint64_t branch, cache;
|
||||
if( view.m_statRange.active )
|
||||
{
|
||||
branch = sqrt( CountHwSamples( hw->branchMiss, view.m_statRange ) * CountHwSamples( hw->branchRetired, view.m_statRange ) );
|
||||
if( hasBranchRetirement )
|
||||
{
|
||||
branch = sqrt( CountHwSamples( hw->branchMiss, view.m_statRange ) * CountHwSamples( hw->branchRetired, view.m_statRange ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
branch = CountHwSamples( hw->branchMiss, view.m_statRange );
|
||||
}
|
||||
cache = sqrt( CountHwSamples( hw->cacheMiss, view.m_statRange ) * CountHwSamples( hw->cacheRef, view.m_statRange ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
branch = sqrt( hw->branchMiss.size() * hw->branchRetired.size() );
|
||||
if( hasBranchRetirement )
|
||||
{
|
||||
branch = sqrt( hw->branchMiss.size() * hw->branchRetired.size() );
|
||||
}
|
||||
else
|
||||
{
|
||||
branch = hw->branchMiss.size();
|
||||
}
|
||||
cache = sqrt( hw->cacheMiss.size() * hw->cacheRef.size() );
|
||||
}
|
||||
assert( as.hwCountAsm.find( addr ) == as.hwCountAsm.end() );
|
||||
|
Loading…
Reference in New Issue
Block a user