summaryrefslogtreecommitdiff
path: root/share/man/man9/stack.9
Commit message (Collapse)AuthorAgeFilesLines
* Reimplement stack capture of running threads on i386 and amd64.Mark Johnston2020-01-311-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | After r355784 the td_oncpu field is no longer synchronized by the thread lock, so the stack capture interrupt cannot be delievered precisely. Fix this using a loop which drops the thread lock and restarts if the wrong thread was sampled from the stack capture interrupt handler. Change the implementation to use a regular interrupt instead of an NMI. Now that we drop the thread lock, there is no advantage to the latter. Simplify the KPIs. Remove stack_save_td_running() and add a return value to stack_save_td(). On platforms that do not support stack capture of running threads, stack_save_td() returns EOPNOTSUPP. If the target thread is running in user mode, stack_save_td() returns EBUSY. Reviewed by: kib Reported by: mjg, pho Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D23355 Notes: svn path=/head/; revision=357334
* Let stack_create(9) take a malloc flags argument.Mark Johnston2017-10-061-4/+7
| | | | | | | | | Reviewed by: cem Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12614 Notes: svn path=/head/; revision=324377
* Fix a bunch of "xref refers to *this* page" igor(1) warnings.Edward Tomasz Napierala2016-06-091-2/+2
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=301719
* Document stack_save_td(9) and stack_save_td_running(9).Mark Johnston2015-09-111-1/+34
| | | | | | | | | Reviewed by: wblock Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3243 Notes: svn path=/head/; revision=287646
* Constify stack argument for functions that don't modify it.Pawel Jakub Dawidek2011-11-161-8/+8
| | | | | | | Reviewed by: ed, kib, jhb Notes: svn path=/head/; revision=227581
* Remove extraneous '>'.Ed Maste2010-04-071-1/+1
| | | | Notes: svn path=/head/; revision=206383
* Add stack_print_short() and stack_print_short_ddb() interfaces toRobert Watson2009-06-241-3/+11
| | | | | | | | | | stack(9), which generate a more compact rendition of a stack trace via the kernel's printf. MFC after: 1 week Notes: svn path=/head/; revision=194828
* Add stack_print_ddb() to the synposis of stack(9), add mlink for it; fixRobert Watson2008-03-141-0/+2
| | | | | | | | | stack_print(9) mlink. Spotted by: attilio Notes: svn path=/head/; revision=177168
* Break out stack(9) from ddb(4):Robert Watson2007-12-021-22/+28
| | | | | | | | | | | | | | | | | | | | | | | - Introduce per-architecture stack_machdep.c to hold stack_save(9). - Introduce per-architecture machine/stack.h to capture any common definitions required between db_trace.c and stack_machdep.c. - Add new kernel option "options STACK"; we will build in stack(9) if it is defined, or also if "options DDB" is defined to provide compatibility with existing users of stack(9). Add new stack_save_td(9) function, which allows the capture of a stacktrace of another thread rather than the current thread, which the existing stack_save(9) was limited to. It requires that the thread be neither swapped out nor running, which is the responsibility of the consumer to enforce. Update stack(9) man page. Build tested: amd64, arm, i386, ia64, powerpc, sparc64, sun4v Runtime tested: amd64 (rwatson), arm (cognet), i386 (rwatson) Notes: svn path=/head/; revision=174195
* Modify stack(9) stack_print() and stack_sbuf_print() routines to use newRobert Watson2007-12-011-2/+15
| | | | | | | | | | | | | | | | | | | 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: svn path=/head/; revision=174137
* Add description of stack_print() and MLINK.Robert Watson2007-11-291-1/+9
| | | | Notes: svn path=/head/; revision=174078
* Fix spelling of stack_capture() to stack_save().Robert Watson2007-11-281-1/+1
| | | | Notes: svn path=/head/; revision=174017
* Add a man page for stack(9).Robert Watson2007-11-271-0/+111
MFC after: 1 week Notes: svn path=/head/; revision=173979