From 306ab3cb6c6703c989da99cd1f6c7784d710930f Mon Sep 17 00:00:00 2001 From: Hiten Pandya Date: Sun, 7 Aug 2005 03:17:37 +0000 Subject: [PATCH] Add 'debug.sizeof.buf' sysctl for determining size of struct buf on a system. Declare the _debug_sizeof sysctl in sys/sysctl.h instead of redundantly declaring in two files. --- sys/kern/subr_disk.c | 4 +--- sys/kern/vfs_bio.c | 4 +++- sys/sys/sysctl.h | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index d017977d4f..b18295f805 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -77,7 +77,7 @@ * @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/subr_disk.c,v 1.20.2.6 2001/10/05 07:14:57 peter Exp $ * $FreeBSD: src/sys/ufs/ufs/ufs_disksubr.c,v 1.44.2.3 2001/03/05 05:42:19 obrien Exp $ - * $DragonFly: src/sys/kern/subr_disk.c,v 1.15 2005/04/30 23:04:21 swildner Exp $ + * $DragonFly: src/sys/kern/subr_disk.c,v 1.16 2005/08/07 03:17:37 hmp Exp $ */ #include @@ -511,8 +511,6 @@ diskpsize(dev_t dev) #endif } -SYSCTL_DECL(_debug_sizeof); - SYSCTL_INT(_debug_sizeof, OID_AUTO, disklabel, CTLFLAG_RD, 0, sizeof(struct disklabel), "sizeof(struct disklabel)"); diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 5e5d4308fb..3104d9b597 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -12,7 +12,7 @@ * John S. Dyson. * * $FreeBSD: src/sys/kern/vfs_bio.c,v 1.242.2.20 2003/05/28 18:38:10 alc Exp $ - * $DragonFly: src/sys/kern/vfs_bio.c,v 1.43 2005/08/05 04:54:42 hmp Exp $ + * $DragonFly: src/sys/kern/vfs_bio.c,v 1.44 2005/08/07 03:17:37 hmp Exp $ */ /* @@ -168,6 +168,8 @@ SYSCTL_INT(_vfs, OID_AUTO, buffreekvacnt, CTLFLAG_RD, &buffreekvacnt, 0, "Amount of time KVA space was deallocated in an arbitrary buffer"); SYSCTL_INT(_vfs, OID_AUTO, bufreusecnt, CTLFLAG_RD, &bufreusecnt, 0, "Amount of time buffer re-use operations were successful"); +SYSCTL_INT(_debug_sizeof, OID_AUTO, buf, CTLFLAG_RD, 0, sizeof(struct buf), + "sizeof(struct buf)"); #if 0 /* diff --git a/sys/sys/sysctl.h b/sys/sys/sysctl.h index 5b68c1412c..0877164cbf 100644 --- a/sys/sys/sysctl.h +++ b/sys/sys/sysctl.h @@ -35,7 +35,7 @@ * * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/sys/sys/sysctl.h,v 1.81.2.10 2003/05/01 22:48:09 trhodes Exp $ - * $DragonFly: src/sys/sys/sysctl.h,v 1.15 2005/08/06 17:57:59 joerg Exp $ + * $DragonFly: src/sys/sys/sysctl.h,v 1.16 2005/08/07 03:17:37 hmp Exp $ */ #ifndef _SYS_SYSCTL_H_ @@ -585,6 +585,7 @@ SYSCTL_DECL(_vm); SYSCTL_DECL(_vfs); SYSCTL_DECL(_net); SYSCTL_DECL(_debug); +SYSCTL_DECL(_debug_sizeof); SYSCTL_DECL(_hw); SYSCTL_DECL(_machdep); SYSCTL_DECL(_user); -- 2.41.0