summaryrefslogtreecommitdiffstats
path: root/sys/x86/include/apicvar.h
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2015-09-11 03:54:37 +0000
committermarkj <markj@FreeBSD.org>2015-09-11 03:54:37 +0000
commite8967c8bd970aade474f6148fbbe4b0e6183751a (patch)
tree28426773e296f84e10d3d95e2a1489974f368b93 /sys/x86/include/apicvar.h
parentb30bc0e211f2c169b84e83127d7d57de24fb688d (diff)
downloadFreeBSD-src-e8967c8bd970aade474f6148fbbe4b0e6183751a.zip
FreeBSD-src-e8967c8bd970aade474f6148fbbe4b0e6183751a.tar.gz
Add stack_save_td_running(), a function to trace the kernel stack of a
running thread. It is currently implemented only on amd64 and i386; on these architectures, it is implemented by raising an NMI on the CPU on which the target thread is currently running. Unlike stack_save_td(), it may fail, for example if the thread is running in user mode. This change also modifies the kern.proc.kstack sysctl to use this function, so that stacks of running threads are shown in the output of "procstat -kk". This is handy for debugging threads that are stuck in a busy loop. Reviewed by: bdrewery, jhb, kib Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3256
Diffstat (limited to 'sys/x86/include/apicvar.h')
-rw-r--r--sys/x86/include/apicvar.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h
index 0bd9fe5..58fcced 100644
--- a/sys/x86/include/apicvar.h
+++ b/sys/x86/include/apicvar.h
@@ -129,12 +129,14 @@
#else
#define IPI_DYN_FIRST (APIC_IPI_INTS + 8)
#endif
-#define IPI_DYN_LAST (254) /* IPIs allocated at runtime */
+#define IPI_DYN_LAST (253) /* IPIs allocated at runtime */
/*
* IPI_STOP_HARD does not need to occupy a slot in the IPI vector space since
* it is delivered using an NMI anyways.
*/
+#define IPI_NMI_FIRST 254
+#define IPI_TRACE 254 /* Interrupt for tracing. */
#define IPI_STOP_HARD 255 /* Stop CPU with a NMI. */
/*
OpenPOWER on IntegriCloud