on 21/09/2010 18:17 m...@freebsd.org said the following: > On Tue, Sep 21, 2010 at 8:07 AM, Andriy Gapon <a...@freebsd.org> wrote: >> 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); > > I'd recommend using stack_print_ddb(), as that avoids any locking > which may hang depending on how the kernel panic'd.
It seems that stack_print_ddb() depends on DDB? -- Andriy Gapon _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"