mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +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 )
|
void SourceView::CountHwStats( AddrStatData& as, Worker& worker, const View& view )
|
||||||
{
|
{
|
||||||
|
const auto hasBranchRetirement = worker.HasHwBranchRetirement();
|
||||||
auto filename = m_source.filename();
|
auto filename = m_source.filename();
|
||||||
for( auto& v : m_asm )
|
for( auto& v : m_asm )
|
||||||
{
|
{
|
||||||
@ -4425,13 +4426,27 @@ void SourceView::CountHwStats( AddrStatData& as, Worker& worker, const View& vie
|
|||||||
if( !hw ) continue;
|
if( !hw ) continue;
|
||||||
uint64_t branch, cache;
|
uint64_t branch, cache;
|
||||||
if( view.m_statRange.active )
|
if( view.m_statRange.active )
|
||||||
|
{
|
||||||
|
if( hasBranchRetirement )
|
||||||
{
|
{
|
||||||
branch = sqrt( CountHwSamples( hw->branchMiss, view.m_statRange ) * CountHwSamples( hw->branchRetired, view.m_statRange ) );
|
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 ) );
|
cache = sqrt( CountHwSamples( hw->cacheMiss, view.m_statRange ) * CountHwSamples( hw->cacheRef, view.m_statRange ) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if( hasBranchRetirement )
|
||||||
{
|
{
|
||||||
branch = sqrt( hw->branchMiss.size() * hw->branchRetired.size() );
|
branch = sqrt( hw->branchMiss.size() * hw->branchRetired.size() );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
branch = hw->branchMiss.size();
|
||||||
|
}
|
||||||
cache = sqrt( hw->cacheMiss.size() * hw->cacheRef.size() );
|
cache = sqrt( hw->cacheMiss.size() * hw->cacheRef.size() );
|
||||||
}
|
}
|
||||||
assert( as.hwCountAsm.find( addr ) == as.hwCountAsm.end() );
|
assert( as.hwCountAsm.find( addr ) == as.hwCountAsm.end() );
|
||||||
|
Loading…
Reference in New Issue
Block a user