Track locking thread on server side.

This commit is contained in:
Bartosz Taudul 2022-07-18 02:06:19 +02:00
parent 440d20b864
commit 4d40a9cb53
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 7 additions and 4 deletions

View File

@ -706,6 +706,7 @@ struct LockMap
int64_t timeTerminate;
bool valid;
bool isContended;
uint64_t lockingThread;
TimeRange range[64];
};

View File

@ -4674,7 +4674,7 @@ bool Worker::Process( const QueueItem& ev )
ProcessLockSharedObtain( ev.lockObtain );
break;
case QueueType::LockSharedRelease:
ProcessLockSharedRelease( ev.lockRelease );
ProcessLockSharedRelease( ev.lockReleaseShared );
break;
case QueueType::LockMark:
ProcessLockMark( ev.lockMark );
@ -5458,6 +5458,7 @@ void Worker::ProcessLockAnnounce( const QueueLockAnnounce& ev )
lm->timeTerminate = 0;
lm->valid = true;
lm->isContended = false;
lm->lockingThread = 0;
m_data.lockMap.emplace( ev.id, lm );
CheckSourceLocation( ev.lckloc );
}
@ -5497,6 +5498,7 @@ void Worker::ProcessLockObtain( const QueueLockObtain& ev )
lev->type = LockEvent::Type::Obtain;
InsertLockEvent( lock, lev, ev.thread, time );
lock.lockingThread = ev.thread;
}
void Worker::ProcessLockRelease( const QueueLockRelease& ev )
@ -5511,7 +5513,7 @@ void Worker::ProcessLockRelease( const QueueLockRelease& ev )
lev->SetSrcLoc( 0 );
lev->type = LockEvent::Type::Release;
InsertLockEvent( lock, lev, ev.thread, time );
InsertLockEvent( lock, lev, lock.lockingThread, time );
}
void Worker::ProcessLockSharedWait( const QueueLockWait& ev )
@ -5546,7 +5548,7 @@ void Worker::ProcessLockSharedObtain( const QueueLockObtain& ev )
InsertLockEvent( lock, lev, ev.thread, time );
}
void Worker::ProcessLockSharedRelease( const QueueLockRelease& ev )
void Worker::ProcessLockSharedRelease( const QueueLockReleaseShared& ev )
{
auto it = m_data.lockMap.find( ev.id );
assert( it != m_data.lockMap.end() );

View File

@ -695,7 +695,7 @@ private:
tracy_force_inline void ProcessLockRelease( const QueueLockRelease& ev );
tracy_force_inline void ProcessLockSharedWait( const QueueLockWait& ev );
tracy_force_inline void ProcessLockSharedObtain( const QueueLockObtain& ev );
tracy_force_inline void ProcessLockSharedRelease( const QueueLockRelease& ev );
tracy_force_inline void ProcessLockSharedRelease( const QueueLockReleaseShared& ev );
tracy_force_inline void ProcessLockMark( const QueueLockMark& ev );
tracy_force_inline void ProcessLockName( const QueueLockName& ev );
tracy_force_inline void ProcessPlotData( const QueuePlotData& ev );