Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146715168
D3243.id8666.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D3243.id8666.diff
View Options
Index: head/share/man/man9/stack.9
===================================================================
--- head/share/man/man9/stack.9
+++ head/share/man/man9/stack.9
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 16, 2011
+.Dd September 10, 2015
.Dt STACK 9
.Os
.Sh NAME
@@ -36,9 +36,11 @@
.Sh SYNOPSIS
.In sys/param.h
.In sys/stack.h
+.Pp
In the kernel configuration file:
.Cd "options DDB"
.Cd "options STACK"
+.Pp
.Ft struct stack *
.Fn stack_create "void"
.Ft void
@@ -63,6 +65,10 @@
.Fn stack_sbuf_print_ddb "struct sbuf sb*" "const struct stack *st"
.Ft void
.Fn stack_save "struct stack *st"
+.Ft void
+.Fn stack_save_td "struct stack *st" "struct thread *td"
+.Ft int
+.Fn stack_save_td_running "struct stack *st" "struct thread *td"
.Sh DESCRIPTION
The
.Nm
@@ -86,6 +92,16 @@
.Pp
A trace of the current kernel thread's call stack may be captured using
.Fn stack_save .
+.Fn stack_save_td
+and
+.Fn stack_save_td_running
+can also be used to capture the stack of a caller-specified thread.
+Callers of these functions must own the thread lock of the specified thread.
+.Fn stack_save_td
+can capture the stack of a kernel thread that is not running or
+swapped out at the time of the call.
+.Fn stack_save_td_running
+can capture the stack of a running kernel thread.
.Pp
.Fn stack_print
and
@@ -130,6 +146,23 @@
and
.Nm stack_put
may be used to manipulate stack data structures directly.
+.Sh RETURN VALUES
+.Fn stack_put
+returns 0 on success.
+Otherwise the
+.Dv struct stack
+does not contain space to record additional frames, and a non-zero value is
+returned.
+.Pp
+.Fn stack_save_td_running
+returns 0 when the stack capture was successful and a non-zero error number
+otherwise.
+In particular,
+.Er EAGAIN
+is returned if the thread was running in user mode at the time that the
+capture was attempted, and
+.Er EOPNOTSUPP
+is returned if the operation is not implemented.
.Sh SEE ALSO
.Xr ddb 4 ,
.Xr printf 9 ,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 5, 11:32 PM (13 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29302906
Default Alt Text
D3243.id8666.diff (1 KB)
Attached To
Mode
D3243: Document stack_save_td and stack_save_td_running.
Attached
Detach File
Event Timeline
Log In to Comment