lockstat
Reader/Writer Lock Probes
Reader/writer locks enforce a policy of allowing
multiple readers or a single writer, but not both to be in a
critical section. These locks are typically used for structures that
are searched more frequently than they are modified and for which
there is substantial time in the critical section. If critical
section times are short, readers/writer locks will implicitly
serialize over the shared memory used to implement the lock, giving
them no advantage over adaptive locks. See
rwlock
(9F)
for more details about the readers/writer locks.
The probes pertaining to readers/writer locks are described in the
following list. For each probe, arg0
contains a
pointer to the krwlock_t
structure that
represents the adaptive lock.
-
rw-acquire
-
Hold-event probe that fires immediately after a readers/writer lock is acquired.
arg1
contains the constantRW_READER
if the lock was acquired as a reader, andRW_WRITER
if the lock was acquired as a writer. -
rw-block
-
Contention-event probe that fires after a thread that has blocked on a held readers/writer lock has reawakened and has acquired the lock.
arg1
contains the length of time (in nanoseconds) that the current thread had to sleep to acquire the lock.arg2
contains the constantRW_READER
if the lock was acquired as a reader, andRW_WRITER
if the lock was acquired as a writer.arg3
andarg4
contain more information on the reason for blocking.arg3
is non-zero if and only if the lock was held as a writer when the current thread blocked.arg4
contains the readers count when the current thread blocked. If both therw-block
andrw-acquire
probes are enabled,rw-block
fires beforerw-acquire
. -
rw-upgrade
-
Hold-event probe that fires after a thread has successfully upgraded a readers/writer lock from a reader to a writer. Upgrades do not have an associated contention event because they are only possible through a non-blocking interface, rw_tryupgrade(9F).
-
rw-downgrade
-
Hold-event probe that fires after a thread had downgraded its ownership of a readers/writer lock from writer to reader. Downgrades do not have an associated contention event because it succeeds without contention.
-
rw-release
-
Hold-event probe that fires immediately after a readers/writer lock is released.
arg1
contains the constantRW_READER
if the released lock was held as a reader, andRW_WRITER
if the released lock was held as a writer. Due to upgrades and downgrades, the lock may not have been released as it was acquired.