mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Store lock mark locations.
This commit is contained in:
parent
ef525067c5
commit
71e16d069e
@ -41,6 +41,7 @@ struct LockEvent
|
||||
|
||||
int64_t time;
|
||||
uint64_t thread;
|
||||
uint64_t srcloc;
|
||||
uint8_t lockCount;
|
||||
uint8_t waitCount;
|
||||
Type type;
|
||||
|
@ -495,6 +495,7 @@ void View::ProcessLockWait( const QueueLockWait& ev )
|
||||
lev->time = ev.time * m_timerMul;
|
||||
lev->thread = ev.thread;
|
||||
lev->type = LockEvent::Type::Wait;
|
||||
lev->srcloc = 0;
|
||||
|
||||
std::lock_guard<std::mutex> lock( m_lock );
|
||||
InsertLockEvent( m_lockMap[ev.id], lev );
|
||||
@ -506,6 +507,7 @@ void View::ProcessLockObtain( const QueueLockObtain& ev )
|
||||
lev->time = ev.time * m_timerMul;
|
||||
lev->thread = ev.thread;
|
||||
lev->type = LockEvent::Type::Obtain;
|
||||
lev->srcloc = 0;
|
||||
|
||||
std::lock_guard<std::mutex> lock( m_lock );
|
||||
InsertLockEvent( m_lockMap[ev.id], lev );
|
||||
@ -517,6 +519,7 @@ void View::ProcessLockRelease( const QueueLockRelease& ev )
|
||||
lev->time = ev.time * m_timerMul;
|
||||
lev->thread = ev.thread;
|
||||
lev->type = LockEvent::Type::Release;
|
||||
lev->srcloc = 0;
|
||||
|
||||
std::lock_guard<std::mutex> lock( m_lock );
|
||||
InsertLockEvent( m_lockMap[ev.id], lev );
|
||||
@ -524,7 +527,27 @@ void View::ProcessLockRelease( const QueueLockRelease& ev )
|
||||
|
||||
void View::ProcessLockMark( const QueueLockMark& ev )
|
||||
{
|
||||
CheckSourceLocation( ev.srcloc );
|
||||
std::lock_guard<std::mutex> lock( m_lock );
|
||||
auto it = m_lockMap[ev.id].timeline.end();
|
||||
for(;;)
|
||||
{
|
||||
--it;
|
||||
if( (*it)->thread == ev.thread )
|
||||
{
|
||||
switch( (*it)->type )
|
||||
{
|
||||
case LockEvent::Type::Obtain:
|
||||
(*it)->srcloc = ev.srcloc;
|
||||
break;
|
||||
case LockEvent::Type::Wait:
|
||||
(*it)->srcloc = ev.srcloc;
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void View::CheckString( uint64_t ptr )
|
||||
|
Loading…
Reference in New Issue
Block a user