From 20421d3abebdb2f55aaf24e390ef8fcf161ba838 Mon Sep 17 00:00:00 2001 From: visa Date: Sat, 22 Apr 2017 11:05:04 +0000 Subject: [PATCH] Shuffle bits into their proper files. Prompted by jmc@ --- share/man/man4/ddb.4 | 30 ++++++++++++++++++++++++++++-- share/man/man4/options.4 | 13 +++++++++++-- share/man/man4/witness.4 | 39 +++------------------------------------ 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/share/man/man4/ddb.4 b/share/man/man4/ddb.4 index dc667b20088..780d156a6e0 100644 --- a/share/man/man4/ddb.4 +++ b/share/man/man4/ddb.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ddb.4,v 1.85 2017/01/24 05:32:00 mpi Exp $ +.\" $OpenBSD: ddb.4,v 1.86 2017/04/22 11:05:04 visa Exp $ .\" $NetBSD: ddb.4,v 1.5 1994/11/30 16:22:09 jtc Exp $ .\" .\" Mach Operating System @@ -25,7 +25,7 @@ .\" any improvements or extensions that they make and grant Carnegie Mellon .\" the rights to redistribute these changes. .\" -.Dd $Mdocdate: January 24 2017 $ +.Dd $Mdocdate: April 22 2017 $ .Dt DDB 4 .Os .Sh NAME @@ -621,6 +621,15 @@ printout, if those are available. .It Ic show extents Prints a detailed list of all extents. .\" -------------------- +.It Ic show locks Op Ar addr +Prints the list of locks held by a thread. +If an optional address is not specified, +.Li curproc +is assumed. +The +.Cm option WITNESS +is required for this command to be available. +.\" -------------------- .It Ic show malloc Op Ar addr Prints malloc debugging information if available. If an optional address is specified, only information about that address @@ -824,6 +833,16 @@ Displays all watchpoints set with the .Ic watch command. .\" -------------------- +.It Ic show witness Op Cm /b +Prints the current order list. +If the +.Cm /b +modifier is specified, the list of found lock order violations is printed +instead. +The +.Cm option WITNESS +is required for this command to be available. +.\" -------------------- .It Ic show all procs Op Cm /anow Display information on all processes. .Pp @@ -878,6 +897,12 @@ Displays address information. .El .\" -------------------- +.It Ic show all locks +Prints the list of locks held by all threads in the system. +The +.Cm option WITNESS +is required for this command to be available. +.\" -------------------- .It Ic show all mounts Op Cm /f Display information on all mounted filesystems. .Pp @@ -1196,6 +1221,7 @@ It may be followed by a ':' and modifiers as described above. .Sh SEE ALSO .Xr gdb 1 , .Xr nm 1 , +.Xr witness 4 , .Xr sysctl.conf 5 , .Xr hangman 6 , .Xr kgdb 7 , diff --git a/share/man/man4/options.4 b/share/man/man4/options.4 index d6361544853..2ea72033236 100644 --- a/share/man/man4/options.4 +++ b/share/man/man4/options.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: options.4,v 1.247 2017/03/20 11:04:25 jmc Exp $ +.\" $OpenBSD: options.4,v 1.248 2017/04/22 11:05:04 visa Exp $ .\" $NetBSD: options.4,v 1.21 1997/06/25 03:13:00 thorpej Exp $ .\" .\" Copyright (c) 1998 Theo de Raadt @@ -34,7 +34,7 @@ .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" -.Dd $Mdocdate: March 20 2017 $ +.Dd $Mdocdate: April 22 2017 $ .Dt OPTIONS 4 .Os .Sh NAME @@ -151,6 +151,15 @@ Turns on debugging for the Virtual File System interface. See .Xr vfs 9 for details. +.It Cd option WITNESS +Compiles in a lock checker for detecting lock order violations in the kernel. +See +.Xr witness 4 +for details. +.It Cd option WITNESS_COUNT= Ns Ar integer +Maximum number of lock types that are tracked by +.Xr witness 4 . +It defaults to 1536. .El .Sh FILE SYSTEMS .Bl -ohang diff --git a/share/man/man4/witness.4 b/share/man/man4/witness.4 index 8ecabbd6985..660ff95f74e 100644 --- a/share/man/man4/witness.4 +++ b/share/man/man4/witness.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: witness.4,v 1.1 2017/04/22 04:00:21 visa Exp $ +.\" $OpenBSD: witness.4,v 1.2 2017/04/22 11:05:04 visa Exp $ .\" .\" Copyright (c) 2001 John H. Baldwin .\" All rights reserved. @@ -32,9 +32,6 @@ .Sh NAME .Nm witness .Nd lock validation facility -.Sh SYNOPSIS -.Cd options WITNESS -.Cd options WITNESS_COUNT .Sh DESCRIPTION The .Nm @@ -54,39 +51,9 @@ code also checks various other conditions such as verifying that one does not recurse on a non-recursive lock, or attempt an upgrade on a shared lock held by another thread. If any of these checks fail, then the kernel will panic. -.Pp -The -.Dv WITNESS_COUNT -kernel option controls the maximum number of -.Nm -entries that are tracked in the kernel. -.Pp -The -.Nm -code also provides three extra -.Xr ddb 4 -commands if -.Nm -is compiled into the kernel: -.Bl -ohang -.It Ic show locks Op Ar addr -Prints the list of locks held by a thread -along with the filename and line number at which each lock was last acquired -by the thread. -If an optional address is not specified, -.Li curproc -is assumed. -.It Ic show all locks -Prints the list of locks held by all threads in the system. -.It Ic show witness Op Cm /b -Prints the current order list to the kernel console. -If the -.Cm /b -modifier is specified, the list of found lock order violations is printed -instead. -.El .Sh SEE ALSO -.Xr ddb 4 +.Xr ddb 4 , +.Xr options 4 .Sh HISTORY The .Nm -- 2.20.1