tracy icon indicating copy to clipboard operation
tracy copied to clipboard

RwLock and Semaphore support?

Open Sobeston opened this issue 8 months ago • 2 comments

Hi, I recently integrated some of tracy's Mutex instrumentation. It's very close to being perfect for my use case, however without support for RwLocks or Semaphores, it falls a bit short.

For an RwLock a half-measure is to only mark write locks, but this means tracy isn't aware of contention on acquiring read locks, which leads to unmarked contention. On the flip side, marking on both writes and reads will incorrectly give you the impression that your reads are contending with each other.

Points where my threads sleep on (unmarked) attempted RwLock read lock acquisitions: Image

Plotting a Semaphore's permits may help a little, but didn't provide me useful insight on my RwLocks.

I'd like to request these features if they have not already.

Sobeston avatar Apr 18 '25 01:04 Sobeston

Tracy can already trace a read-write lock using TracySharedLockable and SharedLockableBase (shared is the name used by the c++ std).

However it is indeed missing instrumentation support for things such as semaphores, events, condition variables... But with https://github.com/wolfpld/tracy/pull/1021 you should at least be able to see what thread triggered the wake up.

Lectem avatar May 24 '25 00:05 Lectem

Awesome work!

Sobeston avatar May 24 '25 00:05 Sobeston