diff options
author | silby <silby@FreeBSD.org> | 2003-06-17 02:34:40 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-06-17 02:34:40 +0000 |
commit | 2896b67c141d60d5d93fd2cc89648de2eb03fdb5 (patch) | |
tree | c2c7cf1df7ca9273930d2b133a68dc8504970f54 /sys/kern/uipc_mbuf.c | |
parent | 9c37ee4474176fb7bc1084da2676dbaa0df82fcf (diff) | |
download | FreeBSD-src-2896b67c141d60d5d93fd2cc89648de2eb03fdb5.zip FreeBSD-src-2896b67c141d60d5d93fd2cc89648de2eb03fdb5.tar.gz |
Hide the m_defrag* statistics under MBUF_STRESS_TEST, there seems
to be no need to see them in the general case (and they aren't
smp-safe anyway.)
Suggested by: hmp
MFC after: 1 week
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 6cfa22d..25cd03f 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -55,11 +55,11 @@ int max_linkhdr; int max_protohdr; int max_hdr; int max_datalen; +#ifdef MBUF_STRESS_TEST int m_defragpackets; int m_defragbytes; int m_defraguseless; int m_defragfailure; -#ifdef MBUF_STRESS_TEST int m_defragrandomfailures; #endif @@ -74,6 +74,7 @@ SYSCTL_INT(_kern_ipc, KIPC_MAX_PROTOHDR, max_protohdr, CTLFLAG_RW, 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, ""); +#ifdef MBUF_STRESS_TEST SYSCTL_INT(_kern_ipc, OID_AUTO, m_defragpackets, CTLFLAG_RD, &m_defragpackets, 0, ""); SYSCTL_INT(_kern_ipc, OID_AUTO, m_defragbytes, CTLFLAG_RD, @@ -82,7 +83,6 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, m_defraguseless, CTLFLAG_RD, &m_defraguseless, 0, ""); SYSCTL_INT(_kern_ipc, OID_AUTO, m_defragfailure, CTLFLAG_RD, &m_defragfailure, 0, ""); -#ifdef MBUF_STRESS_TEST SYSCTL_INT(_kern_ipc, OID_AUTO, m_defragrandomfailures, CTLFLAG_RW, &m_defragrandomfailures, 0, ""); #endif @@ -854,15 +854,21 @@ m_defrag(struct mbuf *m0, int how) m_cat(m_final, m_new); m_new = NULL; } +#ifdef MBUF_STRESS_TEST if (m0->m_next == NULL) m_defraguseless++; +#endif m_freem(m0); m0 = m_final; +#ifdef MBUF_STRESS_TEST m_defragpackets++; m_defragbytes += m0->m_pkthdr.len; +#endif return (m0); nospace: +#ifdef MBUF_STRESS_TEST m_defragfailure++; +#endif if (m_new) m_free(m_new); if (m_final) |