Have lockstat(1) trace locks by name rather than by address.
authormarkj <markj@FreeBSD.org>
Wed, 30 Sep 2015 05:46:56 +0000 (05:46 +0000)
committermarkj <markj@FreeBSD.org>
Wed, 30 Sep 2015 05:46:56 +0000 (05:46 +0000)
commita6fac84fcf38d1a17650296ab2f345d62e855db1
tree729bcc4069ad5e5c942c0b90142c5fec64dadc29
parent5f05617bfc4be8dddb44c324b5036b2a08f969a5
Have lockstat(1) trace locks by name rather than by address.

Previously, lockstat(1) would use a lock's address as its identifier when
consuming data describing lock contention and hold events. After collecting
the requested data, it would use ksyms(4) to resolve lock addresses to
names. Of course, this doesn't work too well for locks contained in
dynamically-allocated memory. This change modifies lockstat(1) to trace the
lock names obtained from the base struct lock_object instead, leading to
output that is generally much more useful.

This change also removes the -c option, which is used to coalesce data for
locks in an array. It's not possible to support this option without also
tracing lock addresses, and since lock arrays in which the lock names are
distinct are not very common in FreeBSD, it's simpler to just remove the
option.

Reviewed by: avg (earlier revision)
Differential Revision: https://reviews.freebsd.org/D3661
cddl/contrib/opensolaris/cmd/lockstat/lockstat.1
cddl/contrib/opensolaris/cmd/lockstat/lockstat.c