summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_shutdown.c14
-rw-r--r--sys/sys/systm.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 1867b8a..d63ece6 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -438,6 +438,20 @@ shutdown_reset(void *junk, int howto)
/* NOTREACHED */ /* assuming reset worked */
}
+/*
+ * Print a backtrace if we can.
+ */
+
+void
+backtrace(void)
+{
+#ifdef DDB
+ db_print_backtrace();
+#else
+ printf("Sorry, need DDB option to print backtrace");
+#endif
+}
+
#ifdef SMP
static u_int panic_cpu = NOCPU;
#endif
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index e3b3a2a..1126762 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -135,6 +135,7 @@ void panic(const char *, ...) __printflike(1, 2);
void panic(const char *, ...) __dead2 __printflike(1, 2);
#endif
+void backtrace(void);
void cpu_boot(int);
void cpu_rootconf(void);
extern uint32_t crc32_tab[];
OpenPOWER on IntegriCloud