1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Store pending lock events, if lock was not yet announced.

This commit is contained in:
Bartosz Taudul
2017-10-04 18:32:22 +02:00
parent 06a08816bd
commit 110e5971d1
2 changed files with 40 additions and 0 deletions
+36
View File
@@ -377,10 +377,13 @@ void View::Process( const QueueItem& ev )
ProcessLockAnnounce( ev.lockAnnounce );
break;
case QueueType::LockWait:
ProcessLockWait( ev.lockWait );
break;
case QueueType::LockObtain:
ProcessLockObtain( ev.lockObtain );
break;
case QueueType::LockRelease:
ProcessLockRelease( ev.lockRelease );
break;
default:
assert( false );
@@ -459,6 +462,39 @@ void View::ProcessLockAnnounce( const QueueLockAnnounce& ev )
m_lockMap.emplace( ev.id, LockMap { ev.srcloc } );
}
void View::ProcessLockWait( const QueueLockWait& ev )
{
auto it = m_lockMap.find( ev.id );
if( it == m_lockMap.end() )
{
auto& v = m_pendingLocks[ev.id];
v.push_back( LockEvent { ev.time, ev.thread, LockEvent::Type::Wait } );
return;
}
}
void View::ProcessLockObtain( const QueueLockObtain& ev )
{
auto it = m_lockMap.find( ev.id );
if( it == m_lockMap.end() )
{
auto& v = m_pendingLocks[ev.id];
v.push_back( LockEvent { ev.time, ev.thread, LockEvent::Type::Obtain } );
return;
}
}
void View::ProcessLockRelease( const QueueLockRelease& ev )
{
auto it = m_lockMap.find( ev.id );
if( it == m_lockMap.end() )
{
auto& v = m_pendingLocks[ev.id];
v.push_back( LockEvent { ev.time, ev.thread, LockEvent::Type::Release } );
return;
}
}
void View::CheckString( uint64_t ptr )
{
if( m_strings.find( ptr ) != m_strings.end() ) return;