From 51710a4597312fda0ce24cc2a8f2b146c73906d3 Mon Sep 17 00:00:00 2001 From: Mike Silbersack Date: Tue, 17 Jun 2003 02:34:40 +0000 Subject: 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 --- sys/kern/uipc_mbuf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sys') diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 6cfa22dadd76..25cd03f30cb3 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) -- cgit v1.3