Update last time when callstack or hw samples arrive.

This commit is contained in:
Bartosz Taudul 2024-03-26 20:48:52 +01:00
parent e071b9043f
commit e77224975d
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -6322,6 +6322,7 @@ void Worker::ProcessCallstackSample( const QueueCallstackSample& ev )
const auto refTime = RefTime( m_refTimeCtx, ev.time ); const auto refTime = RefTime( m_refTimeCtx, ev.time );
const auto t = refTime == 0 ? 0 : TscTime( refTime ); const auto t = refTime == 0 ? 0 : TscTime( refTime );
if( m_data.lastTime < t ) m_data.lastTime = t;
auto& td = *NoticeThread( ev.thread ); auto& td = *NoticeThread( ev.thread );
@ -6366,6 +6367,7 @@ void Worker::ProcessCallstackSampleContextSwitch( const QueueCallstackSample& ev
const auto refTime = RefTime( m_refTimeCtx, ev.time ); const auto refTime = RefTime( m_refTimeCtx, ev.time );
const auto t = refTime == 0 ? 0 : TscTime( refTime ); const auto t = refTime == 0 ? 0 : TscTime( refTime );
if( m_data.lastTime < t ) m_data.lastTime = t;
auto& td = *NoticeThread( ev.thread ); auto& td = *NoticeThread( ev.thread );
@ -6770,6 +6772,7 @@ void Worker::ProcessTidToPid( const QueueTidToPid& ev )
void Worker::ProcessHwSampleCpuCycle( const QueueHwSample& ev ) void Worker::ProcessHwSampleCpuCycle( const QueueHwSample& ev )
{ {
const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); const auto time = ev.time == 0 ? 0 : TscTime( ev.time );
if( m_data.lastTime < time ) m_data.lastTime = time;
auto it = m_data.hwSamples.find( ev.ip ); auto it = m_data.hwSamples.find( ev.ip );
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
it->second.cycles.push_back( time ); it->second.cycles.push_back( time );
@ -6778,6 +6781,7 @@ void Worker::ProcessHwSampleCpuCycle( const QueueHwSample& ev )
void Worker::ProcessHwSampleInstructionRetired( const QueueHwSample& ev ) void Worker::ProcessHwSampleInstructionRetired( const QueueHwSample& ev )
{ {
const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); const auto time = ev.time == 0 ? 0 : TscTime( ev.time );
if( m_data.lastTime < time ) m_data.lastTime = time;
auto it = m_data.hwSamples.find( ev.ip ); auto it = m_data.hwSamples.find( ev.ip );
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
it->second.retired.push_back( time ); it->second.retired.push_back( time );
@ -6786,6 +6790,7 @@ void Worker::ProcessHwSampleInstructionRetired( const QueueHwSample& ev )
void Worker::ProcessHwSampleCacheReference( const QueueHwSample& ev ) void Worker::ProcessHwSampleCacheReference( const QueueHwSample& ev )
{ {
const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); const auto time = ev.time == 0 ? 0 : TscTime( ev.time );
if( m_data.lastTime < time ) m_data.lastTime = time;
auto it = m_data.hwSamples.find( ev.ip ); auto it = m_data.hwSamples.find( ev.ip );
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
it->second.cacheRef.push_back( time ); it->second.cacheRef.push_back( time );
@ -6794,6 +6799,7 @@ void Worker::ProcessHwSampleCacheReference( const QueueHwSample& ev )
void Worker::ProcessHwSampleCacheMiss( const QueueHwSample& ev ) void Worker::ProcessHwSampleCacheMiss( const QueueHwSample& ev )
{ {
const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); const auto time = ev.time == 0 ? 0 : TscTime( ev.time );
if( m_data.lastTime < time ) m_data.lastTime = time;
auto it = m_data.hwSamples.find( ev.ip ); auto it = m_data.hwSamples.find( ev.ip );
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
it->second.cacheMiss.push_back( time ); it->second.cacheMiss.push_back( time );
@ -6802,6 +6808,7 @@ void Worker::ProcessHwSampleCacheMiss( const QueueHwSample& ev )
void Worker::ProcessHwSampleBranchRetired( const QueueHwSample& ev ) void Worker::ProcessHwSampleBranchRetired( const QueueHwSample& ev )
{ {
const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); const auto time = ev.time == 0 ? 0 : TscTime( ev.time );
if( m_data.lastTime < time ) m_data.lastTime = time;
auto it = m_data.hwSamples.find( ev.ip ); auto it = m_data.hwSamples.find( ev.ip );
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
it->second.branchRetired.push_back( time ); it->second.branchRetired.push_back( time );
@ -6811,6 +6818,7 @@ void Worker::ProcessHwSampleBranchRetired( const QueueHwSample& ev )
void Worker::ProcessHwSampleBranchMiss( const QueueHwSample& ev ) void Worker::ProcessHwSampleBranchMiss( const QueueHwSample& ev )
{ {
const auto time = ev.time == 0 ? 0 : TscTime( ev.time ); const auto time = ev.time == 0 ? 0 : TscTime( ev.time );
if( m_data.lastTime < time ) m_data.lastTime = time;
auto it = m_data.hwSamples.find( ev.ip ); auto it = m_data.hwSamples.find( ev.ip );
if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first; if( it == m_data.hwSamples.end() ) it = m_data.hwSamples.emplace( ev.ip, HwSampleData {} ).first;
it->second.branchMiss.push_back( time ); it->second.branchMiss.push_back( time );