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

Announce lock creation.

This commit is contained in:
Bartosz Taudul
2017-10-04 16:16:40 +02:00
parent 069354b5dd
commit 78f8425dc7
4 changed files with 42 additions and 0 deletions
+24
View File
@@ -373,6 +373,9 @@ void View::Process( const QueueItem& ev )
case QueueType::ZoneName:
ProcessZoneName( ev.zoneName );
break;
case QueueType::LockAnnounce:
ProcessLockAnnounce( ev.lockAnnounce );
break;
default:
assert( false );
break;
@@ -441,6 +444,27 @@ void View::ProcessZoneName( const QueueZoneName& ev )
GetTextData( *zone )->zoneName = ev.name;
}
void View::ProcessLockAnnounce( const QueueLockAnnounce& ev )
{
CheckSourceLocation( ev.srcloc );
auto ptr = m_slab.Alloc<LockEvent>();
ptr->srcloc = ev.srcloc;
auto it = m_lockMap.find( ev.id );
if( it == m_lockMap.end() )
{
m_lockMap.emplace( ev.id, ptr );
}
else
{
it->second = ptr;
}
std::lock_guard<std::mutex> lock( m_lock );
m_locks.push_back( ptr );
}
void View::CheckString( uint64_t ptr )
{
if( m_strings.find( ptr ) != m_strings.end() ) return;