Collect hardware sample data.

This commit is contained in:
Bartosz Taudul 2021-05-19 23:05:33 +02:00
parent 101cdd9b4b
commit 373a2b66c6
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 17 additions and 0 deletions

View File

@ -251,6 +251,15 @@ struct SampleDataRange
enum { SampleDataRangeSize = sizeof( SampleDataRange ) };
struct HwSampleData
{
uint32_t cycles;
uint32_t retired;
};
enum { HwSampleDataSize = sizeof( HwSampleData ) };
struct LockEvent
{
enum class Type : uint8_t

View File

@ -6276,10 +6276,16 @@ void Worker::ProcessTidToPid( const QueueTidToPid& ev )
void Worker::ProcessHwSampleCpuCycle( const QueueHwSample& ev )
{
auto it = m_data.hwSamples.find( ev.ip );
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
it->second.cycles++;
}
void Worker::ProcessHwSampleInstructionRetired( const QueueHwSample& ev )
{
auto it = m_data.hwSamples.find( ev.ip );
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
it->second.retired++;
}
void Worker::ProcessParamSetup( const QueueParamSetup& ev )

View File

@ -356,6 +356,8 @@ private:
unordered_flat_map<uint64_t, Vector<uint64_t>> locationCodeAddressList;
unordered_flat_map<const char*, MemoryBlock, charutil::Hasher, charutil::Comparator> sourceFileCache;
unordered_flat_map<uint64_t, HwSampleData> hwSamples;
};
struct MbpsBlock