summaryrefslogtreecommitdiffstats
path: root/share/man/man9/stack.9
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-12-01 22:04:16 +0000
committerrwatson <rwatson@FreeBSD.org>2007-12-01 22:04:16 +0000
commit090235e567d2103bb33c8098bde951eb3c184d05 (patch)
tree078abf5d6f6ec15b509ed5ddcf1ae98c1893fb79 /share/man/man9/stack.9
parenta032664fc9c37f7b29a9713d084d2e3510510531 (diff)
downloadFreeBSD-src-090235e567d2103bb33c8098bde951eb3c184d05.zip
FreeBSD-src-090235e567d2103bb33c8098bde951eb3c184d05.tar.gz
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.
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 dabef1a..17cf509 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
OpenPOWER on IntegriCloud