diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2018-02-20 14:46:23 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2018-02-20 14:46:23 +0000 |
commit | b3a91764b09b858e714e6fb20b054007982ef1aa (patch) | |
tree | e30a969d0fbbe959029c71968ff64ddee7c7ab95 /sys | |
parent | 230dde8b1b3c81393f9edf0afbe04161b95bdb56 (diff) |
Make ddb's "show all locks" command show spinlocks in addition
to sleeplocks.
OK mpi@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_witness.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c index 967f2ffdbf5..36bc45b6e27 100644 --- a/sys/kern/subr_witness.c +++ b/sys/kern/subr_witness.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_witness.c,v 1.5 2017/11/14 14:43:39 visa Exp $ */ +/* $OpenBSD: subr_witness.c,v 1.6 2018/02/20 14:46:22 visa Exp $ */ /*- * Copyright (c) 2008 Isilon Systems, Inc. @@ -30,8 +30,8 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * from BSDI $Id: subr_witness.c,v 1.5 2017/11/14 14:43:39 visa Exp $ - * and BSDI $Id: subr_witness.c,v 1.5 2017/11/14 14:43:39 visa Exp $ + * from BSDI $Id: subr_witness.c,v 1.6 2018/02/20 14:46:22 visa Exp $ + * and BSDI $Id: subr_witness.c,v 1.6 2018/02/20 14:46:22 visa Exp $ */ /* @@ -2096,9 +2096,20 @@ db_witness_list(db_expr_t addr, int have_addr, db_expr_t count, char *modif) void db_witness_list_all(db_expr_t addr, int have_addr, db_expr_t count, char *modif) { + CPU_INFO_ITERATOR cii; + struct cpu_info *ci; + struct lock_list_entry *lock_list; struct process *pr; struct proc *p; + CPU_INFO_FOREACH(cii, ci) { + lock_list = witness_cpu[CPU_INFO_UNIT(ci)].wc_spinlocks; + if (lock_list == NULL || lock_list->ll_count == 0) + continue; + db_printf("CPU %d:\n", CPU_INFO_UNIT(ci)); + witness_list_locks(&lock_list, db_printf); + } + /* * It would be nice to list only threads and processes that actually * held sleep locks, but that information is currently not exported |