mirror of
https://github.com/wolfpld/tracy
synced 2025-05-03 14:03:52 +00:00
Store which threads access any given lock.
This commit is contained in:
parent
4c8e9f7d5d
commit
a99fc01707
@ -467,7 +467,7 @@ void View::ProcessLockAnnounce( const QueueLockAnnounce& ev )
|
|||||||
{
|
{
|
||||||
for( auto& v : it->second )
|
for( auto& v : it->second )
|
||||||
{
|
{
|
||||||
InsertLockEvent( lockmap.timeline, v );
|
InsertLockEvent( lockmap, v );
|
||||||
}
|
}
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
m_pendingLocks.erase( it );
|
m_pendingLocks.erase( it );
|
||||||
@ -490,7 +490,7 @@ void View::ProcessLockWait( const QueueLockWait& ev )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock( m_lock );
|
std::lock_guard<std::mutex> lock( m_lock );
|
||||||
InsertLockEvent( it->second.timeline, lev );
|
InsertLockEvent( it->second, lev );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -510,7 +510,7 @@ void View::ProcessLockObtain( const QueueLockObtain& ev )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock( m_lock );
|
std::lock_guard<std::mutex> lock( m_lock );
|
||||||
InsertLockEvent( it->second.timeline, lev );
|
InsertLockEvent( it->second, lev );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,7 +530,7 @@ void View::ProcessLockRelease( const QueueLockRelease& ev )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock( m_lock );
|
std::lock_guard<std::mutex> lock( m_lock );
|
||||||
InsertLockEvent( it->second.timeline, lev );
|
InsertLockEvent( it->second, lev );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -676,8 +676,10 @@ void View::InsertZone( Event* zone, Event* parent, Vector<Event*>& vec )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void View::InsertLockEvent( Vector<LockEvent*>& timeline, LockEvent* lev )
|
void View::InsertLockEvent( LockMap& lockmap, LockEvent* lev )
|
||||||
{
|
{
|
||||||
|
lockmap.threads.insert( lev->thread );
|
||||||
|
auto& timeline = lockmap.timeline;
|
||||||
if( timeline.empty() || timeline.back()->time < lev->time )
|
if( timeline.empty() || timeline.back()->time < lev->time )
|
||||||
{
|
{
|
||||||
timeline.push_back( lev );
|
timeline.push_back( lev );
|
||||||
|
@ -49,6 +49,7 @@ private:
|
|||||||
uint64_t id;
|
uint64_t id;
|
||||||
uint64_t srcloc;
|
uint64_t srcloc;
|
||||||
Vector<LockEvent*> timeline;
|
Vector<LockEvent*> timeline;
|
||||||
|
std::unordered_set<uint64_t> threads;
|
||||||
};
|
};
|
||||||
|
|
||||||
void Worker();
|
void Worker();
|
||||||
@ -84,7 +85,7 @@ private:
|
|||||||
|
|
||||||
void InsertZone( Event* zone, Event* parent, Vector<Event*>& vec );
|
void InsertZone( Event* zone, Event* parent, Vector<Event*>& vec );
|
||||||
|
|
||||||
void InsertLockEvent( Vector<LockEvent*>& timeline, LockEvent* lev );
|
void InsertLockEvent( LockMap& lockmap, LockEvent* lev );
|
||||||
void UpdateLockCount( Vector<LockEvent*>& timeline, size_t pos );
|
void UpdateLockCount( Vector<LockEvent*>& timeline, size_t pos );
|
||||||
|
|
||||||
uint64_t GetFrameTime( size_t idx ) const;
|
uint64_t GetFrameTime( size_t idx ) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user