1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-01 13:13:53 +00:00

Don't transfer lock release thread id.

We already know which thread is holding the lock.
This commit is contained in:
Bartosz Taudul 2022-07-18 01:56:09 +02:00
parent d6a607b9f0
commit 440d20b864
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 11 additions and 8 deletions

View File

@ -98,7 +98,6 @@ public:
auto item = Profiler::QueueSerial(); auto item = Profiler::QueueSerial();
MemWrite( &item->hdr.type, QueueType::LockRelease ); MemWrite( &item->hdr.type, QueueType::LockRelease );
MemWrite( &item->lockRelease.thread, GetThreadHandle() );
MemWrite( &item->lockRelease.id, m_id ); MemWrite( &item->lockRelease.id, m_id );
MemWrite( &item->lockRelease.time, Profiler::GetTime() ); MemWrite( &item->lockRelease.time, Profiler::GetTime() );
Profiler::QueueSerialFinish(); Profiler::QueueSerialFinish();
@ -313,7 +312,6 @@ public:
auto item = Profiler::QueueSerial(); auto item = Profiler::QueueSerial();
MemWrite( &item->hdr.type, QueueType::LockRelease ); MemWrite( &item->hdr.type, QueueType::LockRelease );
MemWrite( &item->lockRelease.thread, GetThreadHandle() );
MemWrite( &item->lockRelease.id, m_id ); MemWrite( &item->lockRelease.id, m_id );
MemWrite( &item->lockRelease.time, Profiler::GetTime() ); MemWrite( &item->lockRelease.time, Profiler::GetTime() );
Profiler::QueueSerialFinish(); Profiler::QueueSerialFinish();
@ -395,9 +393,9 @@ public:
auto item = Profiler::QueueSerial(); auto item = Profiler::QueueSerial();
MemWrite( &item->hdr.type, QueueType::LockSharedRelease ); MemWrite( &item->hdr.type, QueueType::LockSharedRelease );
MemWrite( &item->lockRelease.thread, GetThreadHandle() ); MemWrite( &item->lockReleaseShared.thread, GetThreadHandle() );
MemWrite( &item->lockRelease.id, m_id ); MemWrite( &item->lockReleaseShared.id, m_id );
MemWrite( &item->lockRelease.time, Profiler::GetTime() ); MemWrite( &item->lockReleaseShared.time, Profiler::GetTime() );
Profiler::QueueSerialFinish(); Profiler::QueueSerialFinish();
} }

View File

@ -9,7 +9,7 @@ namespace tracy
constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; } constexpr unsigned Lz4CompressBound( unsigned isize ) { return isize + ( isize / 255 ) + 16; }
enum : uint32_t { ProtocolVersion = 57 }; enum : uint32_t { ProtocolVersion = 58 };
enum : uint16_t { BroadcastVersion = 2 }; enum : uint16_t { BroadcastVersion = 2 };
using lz4sz_t = uint32_t; using lz4sz_t = uint32_t;

View File

@ -278,11 +278,15 @@ struct QueueLockObtain
struct QueueLockRelease struct QueueLockRelease
{ {
uint32_t thread;
uint32_t id; uint32_t id;
int64_t time; int64_t time;
}; };
struct QueueLockReleaseShared : public QueueLockRelease
{
uint32_t thread;
};
struct QueueLockMark struct QueueLockMark
{ {
uint32_t thread; uint32_t thread;
@ -670,6 +674,7 @@ struct QueueItem
QueueLockWait lockWait; QueueLockWait lockWait;
QueueLockObtain lockObtain; QueueLockObtain lockObtain;
QueueLockRelease lockRelease; QueueLockRelease lockRelease;
QueueLockReleaseShared lockReleaseShared;
QueueLockMark lockMark; QueueLockMark lockMark;
QueueLockName lockName; QueueLockName lockName;
QueueLockNameFat lockNameFat; QueueLockNameFat lockNameFat;
@ -753,7 +758,7 @@ static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ) + sizeof( QueueLockRelease ), sizeof( QueueHeader ) + sizeof( QueueLockRelease ),
sizeof( QueueHeader ) + sizeof( QueueLockWait ), // shared sizeof( QueueHeader ) + sizeof( QueueLockWait ), // shared
sizeof( QueueHeader ) + sizeof( QueueLockObtain ), // shared sizeof( QueueHeader ) + sizeof( QueueLockObtain ), // shared
sizeof( QueueHeader ) + sizeof( QueueLockRelease ), // shared sizeof( QueueHeader ) + sizeof( QueueLockReleaseShared ),
sizeof( QueueHeader ) + sizeof( QueueLockName ), sizeof( QueueHeader ) + sizeof( QueueLockName ),
sizeof( QueueHeader ) + sizeof( QueueMemAlloc ), sizeof( QueueHeader ) + sizeof( QueueMemAlloc ),
sizeof( QueueHeader ) + sizeof( QueueMemAlloc ), // named sizeof( QueueHeader ) + sizeof( QueueMemAlloc ), // named