Module Name: src
Committed By: dyoung
Date: Tue Nov 3 00:29:11 UTC 2009
Modified Files:
src/sys/kern: subr_lockdebug.c
Log Message:
Make lockdebug_lock_print(NULL, ...) dump all locks. Now, in ddb,
'show lock 0x0' dumps all of the locks.
XXX I still need to fix 'show all lock'.
To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/kern/subr_lockdebug.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/subr_lockdebug.c
diff -u src/sys/kern/subr_lockdebug.c:1.40 src/sys/kern/subr_lockdebug.c:1.41
--- src/sys/kern/subr_lockdebug.c:1.40 Mon Oct 5 23:39:27 2009
+++ src/sys/kern/subr_lockdebug.c Tue Nov 3 00:29:11 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_lockdebug.c,v 1.40 2009/10/05 23:39:27 rmind Exp $ */
+/* $NetBSD: subr_lockdebug.c,v 1.41 2009/11/03 00:29:11 dyoung Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.40 2009/10/05 23:39:27 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.41 2009/11/03 00:29:11 dyoung Exp $");
#include "opt_ddb.h"
@@ -792,12 +792,18 @@
lockdebug_t *ld;
TAILQ_FOREACH(ld, &ld_all, ld_achain) {
- if (ld->ld_lock == addr) {
+ if (ld->ld_lock == NULL)
+ continue;
+ if (addr == NULL || ld->ld_lock == addr) {
lockdebug_dump(ld, pr);
- return;
+ if (addr != NULL)
+ return;
}
}
- (*pr)("Sorry, no record of a lock with address %p found.\n", addr);
+ if (addr != NULL) {
+ (*pr)("Sorry, no record of a lock with address %p found.\n",
+ addr);
+ }
#else
(*pr)("Sorry, kernel not built with the LOCKDEBUG option.\n");
#endif /* LOCKDEBUG */