DragonFly submit List (threaded) for 2007-11
[
Date Prev][Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Re: [patch] kill db_print_backtrace()
On Thursday 29 November 2007, YONETANI Tomokazu wrote:
> On Wed, Nov 28, 2007 at 06:28:23PM +0200, Aggelos Economopoulos wrote:
> > Index: dev/acpica5/Osd/OsdSynch.c
> > ===================================================================
> > RCS file: /home/aggelos/imports/vcs/dcvs/src/sys/dev/acpica5/Osd/OsdSynch.c,v
> > retrieving revision 1.11
> > diff -u -p -r1.11 OsdSynch.c
> > --- dev/acpica5/Osd/OsdSynch.c 25 Jan 2007 15:12:06 -0000 1.11
> > +++ dev/acpica5/Osd/OsdSynch.c 28 Nov 2007 15:42:08 -0000
> > @@ -356,7 +356,7 @@ AcpiOsDeleteLock (ACPI_SPINLOCK Spin)
> > }
> >
> > #ifdef ACPI_DEBUG_LOCKS
> > -void db_print_backtrace(void);
> > +void backtrace(void);
> > #endif
> > /*
> > * OS-dependent locking primitives. These routines should be able to be
>
> You can drop this prototype declaration and the surrounding #ifdef too.
Oops. Updated patch follows.
Index: dev/acpica5/Osd/OsdSynch.c
===================================================================
retrieving revision 1.11
diff -u -p -u -r1.11 OsdSynch.c
--- dev/acpica5/Osd/OsdSynch.c
+++ dev/acpica5/Osd/OsdSynch.c
@@ -355,9 +355,6 @@ AcpiOsDeleteLock (ACPI_SPINLOCK Spin)
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.
@@ -379,7 +376,7 @@ AcpiOsAcquireLock (ACPI_SPINLOCK Spin)
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;
@@ -397,7 +394,7 @@ AcpiOsReleaseLock (ACPI_SPINLOCK Spin, U
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;
}
Index: kern/kern_shutdown.c
===================================================================
retrieving revision 1.61
diff -u -p -u -r1.61 kern_shutdown.c
--- kern/kern_shutdown.c
+++ kern/kern_shutdown.c
@@ -103,8 +103,6 @@ int debugger_on_panic = 1;
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
@@ -788,9 +786,9 @@ panic(const char *fmt, ...)
kprintf("cpuid = %d\n", mycpu->gd_cpuid);
#endif
-#if defined(DDB)
if (newpanic && trace_on_panic)
- db_print_backtrace();
+ backtrace();
+#if defined(DDB)
if (debugger_on_panic)
Debugger("panic");
#endif
Index: kern/kern_spinlock.c
===================================================================
retrieving revision 1.11
diff -u -p -u -r1.11 kern_spinlock.c
--- kern/kern_spinlock.c
+++ kern/kern_spinlock.c
@@ -273,16 +273,16 @@ exponential_backoff(struct exponential_b
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);
Index: kern/kern_timeout.c
===================================================================
retrieving revision 1.27
diff -u -p -u -r1.27 kern_timeout.c
--- kern/kern_timeout.c
+++ kern/kern_timeout.c
@@ -360,9 +360,7 @@ callout_reset(struct callout *c, int to_
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;
@@ -415,9 +413,7 @@ callout_stop(struct callout *c)
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);
Index: kern/lwkt_thread.c
===================================================================
retrieving revision 1.110
diff -u -p -u -r1.110 lwkt_thread.c
--- kern/lwkt_thread.c
+++ kern/lwkt_thread.c
@@ -500,9 +500,7 @@ lwkt_switch(void)
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;
Index: kern/uipc_mbuf.c
===================================================================
retrieving revision 1.65
diff -u -p -u -r1.65 uipc_mbuf.c
--- kern/uipc_mbuf.c
+++ kern/uipc_mbuf.c
@@ -850,8 +850,6 @@ m_mclfree(void *arg)
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.
@@ -881,14 +879,12 @@ m_free(struct mbuf *m)
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
Index: net/route.c
===================================================================
retrieving revision 1.32
diff -u -p -u -r1.32 route.c
--- net/route.c
+++ net/route.c
@@ -1302,7 +1302,7 @@ rt_addrinfo_print(int cmd, struct rt_add
#ifdef ROUTE_DEBUG
if (cmd == RTM_DELETE && route_debug > 1)
- db_print_backtrace();
+ backtrace();
#endif
switch(cmd) {
Index: platform/pc32/i386/pmap.c
===================================================================
retrieving revision 1.81
diff -u -p -u -r1.81 pmap.c
--- platform/pc32/i386/pmap.c
+++ platform/pc32/i386/pmap.c
@@ -1930,15 +1930,11 @@ pmap_enter(pmap_t pmap, vm_offset_t va,
#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();
}
mpte = NULL;
@@ -2089,15 +2085,11 @@ pmap_enter_quick(pmap_t pmap, vm_offset_
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();
}
/*
Index: vm/vm_vmspace.c
===================================================================
retrieving revision 1.14
diff -u -p -u -r1.14 vm_vmspace.c
--- vm/vm_vmspace.c
+++ vm/vm_vmspace.c
@@ -481,9 +481,7 @@ vkernel_lwp_exit(struct lwp *lp)
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);
[
Date Prev][Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]