summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_lock.c
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2006-11-13 05:41:46 +0000
committerkmacy <kmacy@FreeBSD.org>2006-11-13 05:41:46 +0000
commitec9503cd0475c67b81826cc55a0dea1cf8f81775 (patch)
treefaa5c9764e0735ad055fed3a6440173e14455120 /sys/kern/kern_lock.c
parent3434de5c13263fd8a5698f3c7a01796478e4032a (diff)
downloadFreeBSD-src-ec9503cd0475c67b81826cc55a0dea1cf8f81775.zip
FreeBSD-src-ec9503cd0475c67b81826cc55a0dea1cf8f81775.tar.gz
track lock class name in a way that doesn't break WITNESS
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r--sys/kern/kern_lock.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 952167a..2e010b7 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -62,8 +62,19 @@ __FBSDID("$FreeBSD$");
#ifdef DDB
#include <ddb/ddb.h>
+static void db_show_lockmgr(struct lock_object *lock);
#endif
+
+struct lock_class lock_class_lockmgr = {
+ "lockmgr",
+ LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE | LC_UPGRADABLE,
+#ifdef DDB
+ db_show_lockmgr
+#endif
+};
+
+
/*
* Locking primitives implementation.
* Locks provide shared/exclusive sychronization.
@@ -166,8 +177,6 @@ _lockmgr(struct lock *lkp, int flags, struct mtx *interlkp,
thr = td;
lock_profile_waitstart(&waitstart);
-
- lkp->lk_object.lo_type = "lockmgr";
if ((flags & LK_INTERNAL) == 0)
mtx_lock(lkp->lk_interlock);
CTR6(KTR_LOCK,
@@ -523,7 +532,7 @@ lockinit(lkp, prio, wmesg, timo, flags)
#ifdef DEBUG_LOCKS
stack_zero(&lkp->lk_stack);
#endif
- lock_profile_object_init(&lkp->lk_object, wmesg);
+ lock_profile_object_init(&lkp->lk_object, &lock_class_lockmgr, wmesg);
}
/*
@@ -648,14 +657,13 @@ lockmgr_chain(struct thread *td, struct thread **ownerp)
return (1);
}
-DB_SHOW_COMMAND(lockmgr, db_show_lockmgr)
+void
+db_show_lockmgr(struct lock_object *lock)
{
struct thread *td;
struct lock *lkp;
- if (!have_addr)
- return;
- lkp = (struct lock *)addr;
+ lkp = (struct lock *)lock;
db_printf("lock type: %s\n", lkp->lk_wmesg);
db_printf("state: ");
OpenPOWER on IntegriCloud