diff options
author | wollman <wollman@FreeBSD.org> | 1997-02-24 20:30:58 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1997-02-24 20:30:58 +0000 |
commit | a6e3c2a3ced8d886e252170fd0fbc11aedf9a3e2 (patch) | |
tree | 7f9fda9e13141358225b618de039c262a753beaf /sys/kern/uipc_mbuf.c | |
parent | 139936b34a895520e9ee8b9a6d3f774754cdcc48 (diff) | |
download | FreeBSD-src-a6e3c2a3ced8d886e252170fd0fbc11aedf9a3e2.zip FreeBSD-src-a6e3c2a3ced8d886e252170fd0fbc11aedf9a3e2.tar.gz |
Create a new branch of the kernel MIB, kern.ipc, to store
all of the configurables and instrumentation related to
inter-process communication mechanisms. Some variables,
like mbuf statistics, are instrumented here for the first
time.
For mbuf statistics: also keep track of m_copym() and
m_pullup() failures, and provide for the user's inspection
the compiled-in values of MSIZE, MHLEN, MCLBYTES, and MINCLSIZE.
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index b816740..7032e44 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 - * $Id$ + * $Id: uipc_mbuf.c,v 1.28 1997/02/18 20:43:05 wollman Exp $ */ #include <sys/param.h> @@ -41,6 +41,7 @@ #define MBTYPES #include <sys/mbuf.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <sys/syslog.h> #include <sys/domain.h> #include <sys/protosw.h> @@ -63,6 +64,15 @@ int max_protohdr; int max_hdr; int max_datalen; +SYSCTL_INT(_kern_ipc, KIPC_MAX_LINKHDR, max_linkhdr, CTLFLAG_RW, + &max_linkhdr, 0, ""); +SYSCTL_INT(_kern_ipc, KIPC_MAX_PROTOHDR, max_protohdr, CTLFLAG_RW, + &max_protohdr, 0, ""); +SYSCTL_INT(_kern_ipc, KIPC_MAX_HDR, max_hdr, CTLFLAG_RW, &max_hdr, 0, ""); +SYSCTL_INT(_kern_ipc, KIPC_MAX_DATALEN, max_datalen, CTLFLAG_RW, + &max_datalen, 0, ""); +SYSCTL_STRUCT(_kern_ipc, KIPC_MBSTAT, mbstat, CTLFLAG_RW, &mbstat, mbstat, ""); + static void m_reclaim __P((void)); /* "number of clusters of pages" */ @@ -78,6 +88,12 @@ mbinit(dummy) int s; mmbfree = NULL; mclfree = NULL; + mbstat.m_msize = MSIZE; + mbstat.m_mclbytes = MCLBYTES; + mbstat.m_minclsize = MINCLSIZE; + mbstat.m_mlen = MLEN; + mbstat.m_mhlen = MHLEN; + s = splimp(); if (m_mballoc(NMB_INIT, M_DONTWAIT) == 0) goto bad; @@ -385,7 +401,7 @@ m_prepend(m, len, how) * continuing for "len" bytes. If len is M_COPYALL, copy to end of mbuf. * The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller. */ -static int MCFail; +#define MCFail (mbstat.m_mcfail) struct mbuf * m_copym(m, off0, len, wait) @@ -656,7 +672,7 @@ m_adj(mp, req_len) * If there is room, it will add up to max_protohdr-len extra bytes to the * contiguous region in an attempt to avoid being called next time. */ -static int MPFail; +#define MPFail (mbstat.m_mpfail) struct mbuf * m_pullup(n, len) |