diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-09-28 18:36:37 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-09-28 18:36:37 +0000 |
commit | 4af7368b7c2c8f50f1f972754d9e26589bc6c83c (patch) | |
tree | 993058d251dfbcad28a0feee6a0e94c39e3ae6fb /sys/kern | |
parent | b132baf16157998866fb4083bebc449ac677617e (diff) |
In low-level suspend routines, set cold=2. In tsleep(), use this to
spit out a ddb trace to console. This should allow us to find suspend
or resume routines which break the rules. It depends on the console
output function being non-sleeping.... but that's another codepath which
should try to be safe when cold is set.
ok kettenis
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_synch.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 3ea27fcdc6d..b81d8b9dc99 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.123 2015/09/11 19:13:22 dlg Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.124 2015/09/28 18:36:36 deraadt Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -49,6 +49,7 @@ #include <sys/syscallargs.h> #include <sys/pool.h> #include <sys/refcnt.h> +#include <ddb/db_output.h> #include <machine/spinlock.h> @@ -115,6 +116,8 @@ tsleep(const volatile void *ident, int priority, const char *wmesg, int timo) KASSERT(timo || __mp_lock_held(&kernel_lock)); #endif + if (cold == 2) + db_stack_dump(); if (cold || panicstr) { int s; /* |