Tracy should show locking time as a zone.
Right now, when a lock is not contended, Tracy doesn't draw it at all. You can tell it to draw the lock, but then it just shows a green rectangle for the lock-held duration. When I manually decorate the locking of a lock with ZoneScoped, I see this:
So this was a scenario where taking the lock somehow took very long: 2 microseconds; and afterwards the lock was immediately released again. But nothing was indicated here before I added that ZoneScoped. Tracy is timing the locking time (the duration to acquire the lock), but is seemingly not reporting it anywhere.
I would have liked to know that locking (even if uncontended) can be very slow. Basicaly, I've been developing for almost a decade not seeing lock-grabbing times when examining Tracy profiles. I didn't realize they were that slow.
My 50cent workaround would be to add ZoneScoped in tracy::Lockable::lock() and tracy::Lockable::unlock(). However, I think a neater approach can be taken, by having the BeforeLock() and AfterLock() also produce a Zone with the one shared GetTime()?
Source: wolfpld/tracy