aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2017-01-16 20:34:42 +0000
committerEd Maste <emaste@FreeBSD.org>2017-01-16 20:34:42 +0000
commitbf9ebe74e23a5f98b7902a00782633c758651fef (patch)
tree1776883942529b7828937abdeb599ac000935387 /sys/kern
parent762d16d9e4a5635990c702b11773aa90f9c359b6 (diff)
downloadsrc-bf9ebe74e23a5f98b7902a00782633c758651fef.tar.gz
src-bf9ebe74e23a5f98b7902a00782633c758651fef.zip
disambiguate msleep KASSERT diagnostics
Previously "panic: msleep" could happen for a few different reasons. Break the KASSERTs out into individual cases to identify the failing condition. Found during the investigation that resulted in r308288. Reviewed by: kib, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8604
Notes
Notes: svn path=/head/; revision=312311
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_synch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c
index b1b497928c86..847c6d70ad94 100644
--- a/sys/kern/kern_synch.c
+++ b/sys/kern/kern_synch.c
@@ -152,8 +152,8 @@ _sleep(void *ident, struct lock_object *lock, int priority,
"Sleeping on \"%s\"", wmesg);
KASSERT(sbt != 0 || mtx_owned(&Giant) || lock != NULL,
("sleeping without a lock"));
- KASSERT(p != NULL, ("msleep1"));
- KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep"));
+ KASSERT(ident != NULL, ("_sleep: NULL ident"));
+ KASSERT(TD_IS_RUNNING(td), ("_sleep: curthread not running"));
if (priority & PDROP)
KASSERT(lock != NULL && lock != &Giant.lock_object,
("PDROP requires a non-Giant lock"));
@@ -247,8 +247,8 @@ msleep_spin_sbt(void *ident, struct mtx *mtx, const char *wmesg,
td = curthread;
p = td->td_proc;
KASSERT(mtx != NULL, ("sleeping without a mutex"));
- KASSERT(p != NULL, ("msleep1"));
- KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep"));
+ KASSERT(ident != NULL, ("msleep_spin_sbt: NULL ident"));
+ KASSERT(TD_IS_RUNNING(td), ("msleep_spin_sbt: curthread not running"));
if (SCHEDULER_STOPPED())
return (0);