summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2022-02-19 23:56:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2022-02-19 23:56:19 +0000
commit5958d016793907e391edde84bfcfd131646e98c4 (patch)
treee4df2f974567dcf5c1b141abc5c217f8a45037c0
parente3ec126e59b0ae3d6be70d2f67d6cd9992b9a956 (diff)
tsleep() prints a stack trace when cold==2. The suspend/resume code has
phases where sleeps are not allowed, and this used to discover it. msleep() needs the same check.
-rw-r--r--sys/kern/kern_synch.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index e993131cd9b..d888cb2b84a 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_synch.c,v 1.181 2022/02/14 11:26:05 claudio Exp $ */
+/* $OpenBSD: kern_synch.c,v 1.182 2022/02/19 23:56:18 deraadt Exp $ */
/* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */
/*
@@ -222,6 +222,10 @@ msleep(const volatile void *ident, struct mutex *mtx, int priority,
if (priority & PCATCH)
KERNEL_ASSERT_LOCKED();
+#ifdef DDB
+ if (cold == 2)
+ db_stack_dump();
+#endif
if (cold || panicstr) {
/*
* After a panic, or during autoconfiguration,