Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Default simple_lock_debugger to "on" on MULTIPROCES...



details:   https://anonhg.NetBSD.org/src/rev/2069ae3e27db
branches:  trunk
changeset: 496443:2069ae3e27db
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Wed Aug 23 15:17:47 2000 +0000

description:
Default simple_lock_debugger to "on" on MULTIPROCESSOR.
Change uninitialized simple_lock check from KASSERT to use SLOCK_WHERE
(to show the "real" source line where the error was detected).

diffstat:

 sys/kern/kern_lock.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 4b28f8a26369 -r 2069ae3e27db sys/kern/kern_lock.c
--- a/sys/kern/kern_lock.c      Wed Aug 23 14:15:06 2000 +0000
+++ b/sys/kern/kern_lock.c      Wed Aug 23 15:17:47 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_lock.c,v 1.44 2000/08/22 19:47:26 thorpej Exp $   */
+/*     $NetBSD: kern_lock.c,v 1.45 2000/08/23 15:17:47 sommerfeld Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -788,7 +788,11 @@
 #endif /* MULTIPROCESSOR */ /* } */
 
 #ifdef DDB /* { */
+#ifdef MULTIPROCESSOR
+int simple_lock_debugger = 1;  /* more serious on MP */
+#else
 int simple_lock_debugger = 0;
+#endif
 #define        SLOCK_DEBUGGER()        if (simple_lock_debugger) Debugger()
 #else
 #define        SLOCK_DEBUGGER()        /* nothing */
@@ -866,8 +870,10 @@
        alp->lock_data = __SIMPLELOCK_LOCKED;
 #endif /* } */
 
-       KASSERT(alp->lock_holder == LK_NOCPU);
-
+       if (alp->lock_holder != LK_NOCPU) {
+               SLOCK_WHERE("simple_lock: uninitialized lock\n",
+                   alp, id, l);
+       }
        alp->lock_file = id;
        alp->lock_line = l;
        alp->lock_holder = cpu_id;



Home | Main Index | Thread Index | Old Index