Date: Tue, 21 Sep 2010 15:07:44 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212964 - head/sys/kern Message-ID: <201009211507.o8LF7iVv097676@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Tue Sep 21 15:07:44 2010 New Revision: 212964 URL: http://svn.freebsd.org/changeset/base/212964 Log: kdb_backtrace: stack(9)-based code to print backtrace without any backend The idea is to add KDB and KDB_TRACE options to GENERIC kernels on stable branches, so that at least the minimal information is produced for non-specific panics like traps on page faults. The GENERICs in stable branches seem to already include STACK option. Reviewed by: attilio MFC after: 2 weeks Modified: head/sys/kern/subr_kdb.c Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Tue Sep 21 12:57:43 2010 (r212963) +++ head/sys/kern/subr_kdb.c Tue Sep 21 15:07:44 2010 (r212964) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_kdb.h" +#include "opt_stack.h" #include <sys/param.h> #include <sys/systm.h> @@ -37,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/pcpu.h> #include <sys/proc.h> #include <sys/smp.h> +#include <sys/stack.h> #include <sys/sysctl.h> #include <machine/kdb.h> @@ -300,6 +302,15 @@ kdb_backtrace(void) printf("KDB: stack backtrace:\n"); kdb_dbbe->dbbe_trace(); } +#ifdef STACK + else { + struct stack st; + + printf("KDB: stack backtrace:\n"); + stack_save(&st); + stack_print(&st); + } +#endif } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009211507.o8LF7iVv097676>