Reconstruct child sample data.

This commit is contained in:
Bartosz Taudul 2021-04-09 20:35:17 +02:00
parent 4dc6222ba1
commit df462f109d
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -1830,12 +1830,32 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks )
it->second.push_back_non_empty( SampleDataRange { time, ip } );
}
}
for( uint16_t i=1; i<callstack.size(); i++ )
{
auto frame = GetCallstackFrame( callstack[i] );
if( !frame ) continue;
const auto symAddr = frame->data[0].symAddr;
auto it = m_data.childSamples.find( symAddr );
if( it == m_data.childSamples.end() )
{
m_data.childSamples.emplace( symAddr, Vector<Int48>( time ) );
}
else
{
it->second.push_back_non_empty( time );
}
}
}
}
for( auto& v : m_data.symbolSamples )
{
pdqsort_branchless( v.second.begin(), v.second.end(), []( const auto& lhs, const auto& rhs ) { return lhs.time.Val() < rhs.time.Val(); } );
}
for( auto& v : m_data.childSamples )
{
pdqsort_branchless( v.second.begin(), v.second.end(), []( const auto& lhs, const auto& rhs ) { return lhs.Val() < rhs.Val(); } );
}
std::lock_guard<std::mutex> lock( m_data.lock );
m_data.symbolSamplesReady = true;
} ) );