Project

General

Profile

Bug #867 ยป db_print_backtrace_removal.patch

aoiko, 02/05/2009 06:40 PM

View differences:

sys/ddb/ddb.h
#endif
/*
* Print backtrace. (Machine-Dependant)
*/
void db_print_backtrace(void);
/*
* Command table.
*/
struct command {
sys/dev/acpica5/Osd/OsdSynch.c
kfree(Spin, M_ACPISEM);
}
#ifdef ACPI_DEBUG_LOCKS
void db_print_backtrace(void);
#endif
/*
* OS-dependent locking primitives. These routines should be able to be
* called from an interrupt-handler or cpu_idle thread.
......
kprintf("%p(%s:%d): acpi_spinlock %p already held by %p(%s:%d)\n",
curthread, func, line, Spin, Spin->owner, Spin->func,
Spin->line);
db_print_backtrace();
backtrace();
} else {
Spin->owner = curthread;
Spin->func = func;
......
if (Spin->owner != NULL) {
kprintf("%p: acpi_spinlock %p is unexectedly held by %p(%s:%d)\n",
curthread, Spin, Spin->owner, Spin->func, Spin->line);
db_print_backtrace();
backtrace();
} else
return;
}
sys/kern/kern_debug.c
/*
* Simple DDB stack trace funtionality.
*/
#ifndef DDB
void
backtrace(void)
{
#ifdef DDB
kprintf("Stack backtrace:\n");
db_print_backtrace();
#else
kprintf("Cannot print stack trace.\n");
kprintf("DDB kernel option is needed.\n");
#endif
}
#endif
sys/kern/kern_shutdown.c
#include <machine/stdarg.h>
#ifdef DDB
#include <ddb/ddb.h>
#ifdef DDB_UNATTENDED
int debugger_on_panic = 0;
#else
......
SYSCTL_INT(_debug, OID_AUTO, debugger_on_panic, CTLFLAG_RW,
&debugger_on_panic, 0, "Run debugger on kernel panic");
extern void db_print_backtrace(void);
#ifdef DDB_TRACE
int trace_on_panic = 1;
#else
......
#if defined(DDB)
if (newpanic && trace_on_panic)
db_print_backtrace();
backtrace();
if (debugger_on_panic)
Debugger("panic");
#endif
sys/kern/kern_spinlock.c
* $DragonFly: src/sys/kern/kern_spinlock.c,v 1.16 2008/09/11 01:11:42 y0netan1 Exp $
*/
#include "opt_ddb.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/types.h>
......
#include <sys/proc.h>
#endif
#include <sys/priv.h>
#include <ddb/ddb.h>
#include <machine/atomic.h>
#include <machine/cpufunc.h>
#include <machine/specialreg.h>
......
kprintf("spin_lock: %p, indefinite wait!\n", bo->mtx);
if (panicstr)
return (TRUE);
#if defined(INVARIANTS) && defined(DDB)
#if defined(INVARIANTS)
if (spin_lock_test_mode) {
db_print_backtrace();
backtrace();
return (TRUE);
}
#endif
++bo->nsec;
#if defined(INVARIANTS) && defined(DDB)
#if defined(INVARIANTS)
if (bo->nsec == 11)
db_print_backtrace();
backtrace();
#endif
if (bo->nsec == 60)
panic("spin_lock: %p, indefinite wait!\n", bo->mtx);
sys/kern/kern_timeout.c
* The per-cpu augmentation was done by Matthew Dillon.
*/
#include "opt_ddb.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/callout.h>
......
#include <sys/interrupt.h>
#include <sys/thread.h>
#include <sys/thread2.h>
#include <ddb/ddb.h>
#ifndef MAX_SOFTCLOCK_STEPS
#define MAX_SOFTCLOCK_STEPS 100 /* Maximum allowed value of steps. */
......
kprintf(
"callout_reset(%p) from %p: callout was not initialized\n",
c, ((int **)&c)[-1]);
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
#endif
gd = mycpu;
......
kprintf(
"callout_stop(%p) from %p: callout was not initialized\n",
c, ((int **)&c)[-1]);
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
#endif
crit_enter_gd(gd);
sys/kern/lwkt_thread.c
* to use a critical section to avoid problems. Foreign thread
* scheduling is queued via (async) IPIs.
*/
#include "opt_ddb.h"
#include <sys/param.h>
#include <sys/systm.h>
......
#include <machine/stdarg.h>
#include <machine/smp.h>
#ifdef DDB
#include <ddb/ddb.h>
#endif
static MALLOC_DEFINE(M_THREAD, "thread", "lwkt threads");
......
td->td_flags |= TDF_PANICWARN;
kprintf("Warning: thread switch from interrupt or IPI, "
"thread %p (%s)\n", td, td->td_comm);
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
lwkt_switch();
gd->gd_intr_nesting_level = savegdnest;
sys/kern/uipc_mbuf.c
*/
#include "opt_param.h"
#include "opt_ddb.h"
#include "opt_mbuf_stress_test.h"
#include <sys/param.h>
#include <sys/systm.h>
......
objcache_put(mclmeta_cache, mcl);
}
extern void db_print_backtrace(void);
/*
* Free a single mbuf and any associated external storage. The successor,
* if any, is returned.
......
KKASSERT(m->m_nextpkt == NULL);
#else
if (m->m_nextpkt != NULL) {
#ifdef DDB
static int afewtimes = 10;
if (afewtimes-- > 0) {
kprintf("mfree: m->m_nextpkt != NULL\n");
db_print_backtrace();
backtrace();
}
#endif
m->m_nextpkt = NULL;
}
#endif
sys/platform/pc32/i386/db_trace.c
}
void
db_print_backtrace(void)
backtrace(void)
{
register_t ebp;
sys/platform/pc32/i386/pmap.c
#include <machine/pmap.h>
#include <machine/pmap_inval.h>
#include <ddb/ddb.h>
#define PMAP_KEEP_PDIRS
#ifndef PMAP_SHPGPERPROC
#define PMAP_SHPGPERPROC 200
......
#endif
if (va < UPT_MAX_ADDRESS && pmap == &kernel_pmap) {
kprintf("Warning: pmap_enter called on UVA with kernel_pmap\n");
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
if (va >= UPT_MAX_ADDRESS && pmap != &kernel_pmap) {
kprintf("Warning: pmap_enter called on KVA without kernel_pmap\n");
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
/*
......
if (va < UPT_MAX_ADDRESS && pmap == &kernel_pmap) {
kprintf("Warning: pmap_enter_quick called on UVA with kernel_pmap\n");
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
if (va >= UPT_MAX_ADDRESS && pmap != &kernel_pmap) {
kprintf("Warning: pmap_enter_quick called on KVA without kernel_pmap\n");
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
KKASSERT(va < UPT_MIN_ADDRESS); /* assert used on user pmaps only */
sys/platform/pc64/amd64/db_trace.c
}
void
db_print_backtrace(void)
backtrace(void)
{
register_t rbp;
sys/platform/pc64/amd64/pmap.c
#include <machine/pmap.h>
#include <machine/pmap_inval.h>
#include <ddb/ddb.h>
#define PMAP_KEEP_PDIRS
#ifndef PMAP_SHPGPERPROC
#define PMAP_SHPGPERPROC 200
......
#endif
if (va < UPT_MAX_ADDRESS && pmap == &kernel_pmap) {
kprintf("Warning: pmap_enter called on UVA with kernel_pmap\n");
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
if (va >= UPT_MAX_ADDRESS && pmap != &kernel_pmap) {
kprintf("Warning: pmap_enter called on KVA without kernel_pmap\n");
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
/*
......
if (va < UPT_MAX_ADDRESS && pmap == &kernel_pmap) {
kprintf("Warning: pmap_enter_quick called on UVA with kernel_pmap\n");
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
if (va >= UPT_MAX_ADDRESS && pmap != &kernel_pmap) {
kprintf("Warning: pmap_enter_quick called on KVA without kernel_pmap\n");
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
}
KKASSERT(va < UPT_MIN_ADDRESS); /* assert used on user pmaps only */
sys/platform/vkernel/i386/db_trace.c
}
void
db_print_backtrace(void)
backtrace(void)
{
register_t ebp;
sys/vm/vm_vmspace.c
*
* $DragonFly: src/sys/vm/vm_vmspace.c,v 1.14 2007/08/15 03:15:07 dillon Exp $
*/
#include "opt_ddb.h"
#include <sys/param.h>
#include <sys/kernel.h>
......
#include <vm/vm_extern.h>
#include <vm/pmap.h>
#include <ddb/ddb.h>
#include <machine/vmparam.h>
......
if ((ve = vklp->ve) != NULL) {
kprintf("Warning, pid %d killed with "
"active VC!\n", lp->lwp_proc->p_pid);
#ifdef DDB
db_print_backtrace();
#endif
backtrace();
pmap_setlwpvm(lp, lp->lwp_proc->p_vmspace);
vklp->ve = NULL;
KKASSERT(ve->refs > 0);
    (1-1/1)