Process additional hardware sample data.

This commit is contained in:
Bartosz Taudul 2021-05-20 02:19:11 +02:00
parent 5f3d1c0faf
commit 227a8d1aee
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 48 additions and 0 deletions

View File

@ -255,6 +255,10 @@ struct HwSampleData
{
uint32_t cycles;
uint32_t retired;
uint32_t cacheRef;
uint32_t cacheMiss;
uint32_t branchRetired;
uint32_t branchMiss;
};
enum { HwSampleDataSize = sizeof( HwSampleData ) };

View File

@ -4467,6 +4467,18 @@ bool Worker::Process( const QueueItem& ev )
case QueueType::HwSampleInstructionRetired:
ProcessHwSampleInstructionRetired( ev.hwSample );
break;
case QueueType::HwSampleCacheReference:
ProcessHwSampleCacheReference( ev.hwSample );
break;
case QueueType::HwSampleCacheMiss:
ProcessHwSampleCacheMiss( ev.hwSample );
break;
case QueueType::HwSampleBranchRetired:
ProcessHwSampleBranchRetired( ev.hwSample );
break;
case QueueType::HwSampleBranchMiss:
ProcessHwSampleBranchMiss( ev.hwSample );
break;
case QueueType::ParamSetup:
ProcessParamSetup( ev.paramSetup );
break;
@ -6288,6 +6300,34 @@ void Worker::ProcessHwSampleInstructionRetired( const QueueHwSample& ev )
it->second.retired++;
}
void Worker::ProcessHwSampleCacheReference( 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.cacheRef++;
}
void Worker::ProcessHwSampleCacheMiss( 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.cacheMiss++;
}
void Worker::ProcessHwSampleBranchRetired( 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.branchRetired++;
}
void Worker::ProcessHwSampleBranchMiss( 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.branchMiss++;
}
void Worker::ProcessParamSetup( const QueueParamSetup& ev )
{
CheckString( ev.name );

View File

@ -686,6 +686,10 @@ private:
tracy_force_inline void ProcessTidToPid( const QueueTidToPid& ev );
tracy_force_inline void ProcessHwSampleCpuCycle( const QueueHwSample& ev );
tracy_force_inline void ProcessHwSampleInstructionRetired( const QueueHwSample& ev );
tracy_force_inline void ProcessHwSampleCacheReference( const QueueHwSample& ev );
tracy_force_inline void ProcessHwSampleCacheMiss( const QueueHwSample& ev );
tracy_force_inline void ProcessHwSampleBranchRetired( const QueueHwSample& ev );
tracy_force_inline void ProcessHwSampleBranchMiss( const QueueHwSample& ev );
tracy_force_inline void ProcessParamSetup( const QueueParamSetup& ev );
tracy_force_inline void ProcessCpuTopology( const QueueCpuTopology& ev );
tracy_force_inline void ProcessMemNamePayload( const QueueMemNamePayload& ev );