diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2019-10-15 21:24:25 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2019-10-15 21:24:25 +0000 |
commit | bac060388f5c5abd81b282f0deb372df88bee101 (patch) | |
tree | 02a35128a39a2811788853d801b3111661408273 /sys/kern/kern_synch.c | |
parent | 5dab131339420a84be4163e539318a607ba6a063 (diff) | |
download | src-bac060388f5c5abd81b282f0deb372df88bee101.tar.gz src-bac060388f5c5abd81b282f0deb372df88bee101.zip |
When assertion for a thread not being in an epoch fails also print all
entered epochs. Works with EPOCH_TRACE only.
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D22017
Notes
Notes:
svn path=/head/; revision=353596
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r-- | sys/kern/kern_synch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 04bc6430bbb2..53bef0798c24 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -148,6 +148,10 @@ _sleep(void *ident, struct lock_object *lock, int priority, ("sleeping without a lock")); KASSERT(ident != NULL, ("_sleep: NULL ident")); KASSERT(TD_IS_RUNNING(td), ("_sleep: curthread not running")); +#ifdef EPOCH_TRACE + if (__predict_false(curthread->td_epochnest > 0)) + epoch_trace_list(curthread); +#endif KASSERT(td->td_epochnest == 0, ("sleeping in an epoch section")); if (priority & PDROP) KASSERT(lock != NULL && lock != &Giant.lock_object, |