aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9/stack.9
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2007-12-01 22:04:16 +0000
committerRobert Watson <rwatson@FreeBSD.org>2007-12-01 22:04:16 +0000
commit9ccca7d1b1390a99479d0b6952c4fed6a0888933 (patch)
tree078abf5d6f6ec15b509ed5ddcf1ae98c1893fb79 /share/man/man9/stack.9
parent66e7bdd4dcf6adb90bc340aedb7605c4b22c50c5 (diff)
Modify stack(9) stack_print() and stack_sbuf_print() routines to use new
linker interfaces for looking up function names and offsets from instruction pointers. Create two variants of each call: one that is "DDB-safe" and avoids locking in the linker, and one that is safe for use in live kernels, by virtue of observing locking, and in particular safe when kernel modules are being loaded and unloaded simultaneous to their use. This will allow them to be used outside of debugging contexts. Modify two of three current stack(9) consumers to use the DDB-safe interfaces, as they run in low-level debugging contexts, such as inside lockmgr(9) and the kernel memory allocator. Update man page.
Notes
Notes: svn path=/head/; revision=174137
Diffstat (limited to 'share/man/man9/stack.9')
-rw-r--r--share/man/man9/stack.917
1 files changed, 15 insertions, 2 deletions
diff --git a/share/man/man9/stack.9 b/share/man/man9/stack.9
index dabef1aa321b..17cf50946d79 100644
--- a/share/man/man9/stack.9
+++ b/share/man/man9/stack.9
@@ -54,6 +54,8 @@ In kernel configuration files:
.Ft void
.Fn stack_sbuf_print "struct sbuf sb*" "struct stack *st"
.Ft void
+.Fn stack_sbuf_print_ddb "struct sbuf sb*" "struct stack *st"
+.Ft void
.Fn stack_save "struct stack *st"
.Sh DESCRIPTION
The
@@ -96,7 +98,17 @@ as described in
.Xr sbuf 9 .
This function may sleep if an auto-extending
.Dv struct sbuf
-is used.
+is used, and because the kernel linker (used to look up symbol names) uses
+.Xr sx 9
+locks.
+.Pp
+In locking-sensitive environments, such as
+.Xr DDB 4 ,
+the unsynchronized
+.Fn stack_sbuf_print_ddb
+variant may be invoked; this makes use of kernel linker data structures to
+look up symbol names without following locking protocols, so is appropriate
+for use in the debugger but not while the system is live.
.Pp
The utility functions
.Nm stack_zero ,
@@ -107,7 +119,8 @@ may be used to manipulate stack data structures directly.
.Sh SEE ALSO
.Xr DDB 4 ,
.Xr printf 9 ,
-.Xr sbuf 9
+.Xr sbuf 9 ,
+.Xr sx 9
.Sh AUTHORS
.An -nosplit
The