Allow time limiting sampled call stacks statistics.

This commit is contained in:
Bartosz Taudul 2020-08-07 19:26:19 +02:00
parent b418c98e63
commit d151aff237

View File

@ -12041,12 +12041,37 @@ void View::DrawStatistics()
data.push_back_no_space_check( SymList { v.first, 0, 0 } );
}
else
{
if( m_statRange.active )
{
auto samples = m_worker.GetSamplesForSymbol( v.first );
if( samples )
{
auto it = std::lower_bound( samples->begin(), samples->end(), m_statRange.min, [] ( const auto& lhs, const auto& rhs ) { return lhs.Val() < rhs; } );
if( it != samples->end() )
{
auto end = std::lower_bound( it, samples->end(), m_statRange.max, [] ( const auto& lhs, const auto& rhs ) { return lhs.Val() < rhs; } );
const auto count = uint32_t( end - it );
data.push_back_no_space_check( SymList { v.first, 0, count } );
}
else
{
data.push_back_no_space_check( SymList { v.first, 0, 0 } );
}
}
else
{
data.push_back_no_space_check( SymList { v.first, 0, 0 } );
}
}
else
{
data.push_back_no_space_check( SymList { v.first, it->second.incl, it->second.excl } );
}
}
}
}
}
else
{
for( auto& v : symMap )
@ -12057,12 +12082,37 @@ void View::DrawStatistics()
data.push_back_no_space_check( SymList { v.first, 0, 0 } );
}
else
{
if( m_statRange.active )
{
auto samples = m_worker.GetSamplesForSymbol( v.first );
if( samples )
{
auto it = std::lower_bound( samples->begin(), samples->end(), m_statRange.min, [] ( const auto& lhs, const auto& rhs ) { return lhs.Val() < rhs; } );
if( it != samples->end() )
{
auto end = std::lower_bound( it, samples->end(), m_statRange.max, [] ( const auto& lhs, const auto& rhs ) { return lhs.Val() < rhs; } );
const auto count = uint32_t( end - it );
data.push_back_no_space_check( SymList { v.first, 0, count } );
}
else
{
data.push_back_no_space_check( SymList { v.first, 0, 0 } );
}
}
else
{
data.push_back_no_space_check( SymList { v.first, 0, 0 } );
}
}
else
{
data.push_back_no_space_check( SymList { v.first, it->second.incl, it->second.excl } );
}
}
}
}
}
else
{
data.reserve( symStat.size() );
@ -12089,12 +12139,48 @@ void View::DrawStatistics()
}
}
if( pass )
{
if( m_statRange.active )
{
auto samples = m_worker.GetSamplesForSymbol( v.first );
if( samples )
{
auto it = std::lower_bound( samples->begin(), samples->end(), m_statRange.min, [] ( const auto& lhs, const auto& rhs ) { return lhs.Val() < rhs; } );
if( it != samples->end() )
{
auto end = std::lower_bound( it, samples->end(), m_statRange.max, [] ( const auto& lhs, const auto& rhs ) { return lhs.Val() < rhs; } );
const auto count = uint32_t( end - it );
data.push_back_no_space_check( SymList { v.first, 0, count } );
}
}
}
else
{
data.push_back_no_space_check( SymList { v.first, v.second.incl, v.second.excl } );
}
}
}
}
}
else
{
if( m_statRange.active )
{
for( auto& v : symStat )
{
auto samples = m_worker.GetSamplesForSymbol( v.first );
if( samples )
{
auto it = std::lower_bound( samples->begin(), samples->end(), m_statRange.min, [] ( const auto& lhs, const auto& rhs ) { return lhs.Val() < rhs; } );
if( it != samples->end() )
{
auto end = std::lower_bound( it, samples->end(), m_statRange.max, [] ( const auto& lhs, const auto& rhs ) { return lhs.Val() < rhs; } );
const auto count = uint32_t( end - it );
data.push_back_no_space_check( SymList { v.first, 0, count } );
}
}
}
}
else
{
for( auto& v : symStat )
@ -12103,6 +12189,7 @@ void View::DrawStatistics()
}
}
}
}
if( !m_statSeparateInlines )
{