mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Store pending lock events, if lock was not yet announced.
This commit is contained in:
parent
06a08816bd
commit
110e5971d1
@ -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;
|
||||
|
@ -64,6 +64,9 @@ private:
|
||||
void ProcessZoneText( const QueueZoneText& ev );
|
||||
void ProcessZoneName( const QueueZoneName& ev );
|
||||
void ProcessLockAnnounce( const QueueLockAnnounce& ev );
|
||||
void ProcessLockWait( const QueueLockWait& ev );
|
||||
void ProcessLockObtain( const QueueLockObtain& ev );
|
||||
void ProcessLockRelease( const QueueLockRelease& ev );
|
||||
|
||||
void CheckString( uint64_t ptr );
|
||||
void CheckThreadString( uint64_t id );
|
||||
@ -140,6 +143,7 @@ private:
|
||||
std::unordered_set<uint64_t> m_pendingSourceLocation;
|
||||
std::unordered_map<uint64_t, Event*> m_pendingCustomStrings;
|
||||
std::unordered_map<uint64_t, uint32_t> m_threadMap;
|
||||
std::unordered_map<uint64_t, std::vector<LockEvent>> m_pendingLocks;
|
||||
|
||||
Slab<EventSize*1024*1024> m_slab;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user