Page MenuHomeFreeBSD

D34461.diff
No OneTemporary

D34461.diff

diff --git a/share/man/man9/stack.9 b/share/man/man9/stack.9
--- a/share/man/man9/stack.9
+++ b/share/man/man9/stack.9
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 31, 2020
+.Dd March 6, 2022
.Dt STACK 9
.Os
.Sh NAME
@@ -48,7 +48,7 @@
.Ft int
.Fn stack_put "struct stack *st" "vm_offset_t pc"
.Ft void
-.Fn stack_copy "const struct stack *src" "struct stack dst"
+.Fn stack_copy "const struct stack *src" "struct stack *dst"
.Ft void
.Fn stack_zero "struct stack *st"
.Ft void
@@ -60,9 +60,9 @@
.Ft void
.Fn stack_print_short_ddb "const struct stack *st"
.Ft void
-.Fn stack_sbuf_print "struct sbuf sb*" "const struct stack *st"
+.Fn stack_sbuf_print "struct sbuf *sb" "const struct stack *st"
.Ft void
-.Fn stack_sbuf_print_ddb "struct sbuf sb*" "const struct stack *st"
+.Fn stack_sbuf_print_ddb "struct sbuf *sb" "const struct stack *st"
.Ft void
.Fn stack_save "struct stack *st"
.Ft int
@@ -81,21 +81,26 @@
.Pp
Each stack trace is described by a
.Vt "struct stack" .
-Before a trace may be created or otherwise manipulated, storage for the trace
-must be allocated with
+It can be declared in the usual ways, including on the stack, and optionally
+initialized with
+.Fn stack_zero ,
+though this is not necessary before saving a trace.
+It can also be dynamically allocated with
.Fn stack_create .
The
.Ar flags
argument is passed to
.Xr malloc 9 .
-Memory associated with a trace is freed by calling
+This dynamic allocation must be freed with
.Fn stack_destroy .
.Pp
A trace of the current thread's kernel call stack may be captured using
.Fn stack_save .
.Fn stack_save_td
can be used to capture the kernel stack of a caller-specified thread.
-Callers of these functions must own the thread lock of the specified thread,
+Callers of
+.Fn stack_save_td
+must own the thread lock of the specified thread,
and the thread's stack must not be swapped out.
.Fn stack_save_td
can capture the kernel stack of a running thread, though note that this is

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 24, 6:03 PM (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26068420
Default Alt Text
D34461.diff (1 KB)

Event Timeline