diff options
author | Attilio Rao <attilio@FreeBSD.org> | 2011-09-08 12:56:26 +0000 |
---|---|---|
committer | Attilio Rao <attilio@FreeBSD.org> | 2011-09-08 12:56:26 +0000 |
commit | fa2b39a18d45ad2d45db156454ad916b20a5ab15 (patch) | |
tree | fc833be579c529eada2aa0565d3869ad2cebefd6 /sys/kern/kern_shutdown.c | |
parent | dfdd3320563293af72effba0ea2826a1a934106e (diff) | |
download | src-fa2b39a18d45ad2d45db156454ad916b20a5ab15.tar.gz src-fa2b39a18d45ad2d45db156454ad916b20a5ab15.zip |
Notes
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r-- | sys/kern/kern_shutdown.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 7621b151d9bf..6a8a597637e5 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include "opt_kdb.h" #include "opt_panic.h" -#include "opt_show_busybufs.h" #include "opt_sched.h" #include "opt_watchdog.h" @@ -66,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include <sys/smp.h> #include <sys/sysctl.h> #include <sys/sysproto.h> +#include <sys/vnode.h> #ifdef SW_WATCHDOG #include <sys/watchdog.h> #endif @@ -123,6 +123,14 @@ TUNABLE_INT("kern.sync_on_panic", &sync_on_panic); SYSCTL_NODE(_kern, OID_AUTO, shutdown, CTLFLAG_RW, 0, "Shutdown environment"); +#ifndef DIAGNOSTIC +static int show_busybufs; +#else +static int show_busybufs = 1; +#endif +SYSCTL_INT(_kern_shutdown, OID_AUTO, show_busybufs, CTLFLAG_RW, + &show_busybufs, 0, ""); + /* * Variable panicstr contains argument to first call to panic; used as flag * to indicate that the kernel has already called panic. @@ -389,13 +397,17 @@ kern_reboot(int howto) } #endif nbusy++; -#if defined(SHOW_BUSYBUFS) || defined(DIAGNOSTIC) - printf( - "%d: bufobj:%p, flags:%0x, blkno:%ld, lblkno:%ld\n", - nbusy, bp->b_bufobj, - bp->b_flags, (long)bp->b_blkno, - (long)bp->b_lblkno); -#endif + if (show_busybufs > 0) { + printf( + "%d: buf:%p, vnode:%p, flags:%0x, blkno:%jd, lblkno:%jd, buflock:", + nbusy, bp, bp->b_vp, bp->b_flags, + (intmax_t)bp->b_blkno, + (intmax_t)bp->b_lblkno); + BUF_LOCKPRINTINFO(bp); + if (show_busybufs > 1) + vn_printf(bp->b_vp, + "vnode content: "); + } } } if (nbusy) { |