mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
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
This commit is contained in:
parent
5f3ee7fe32
commit
51710a4597
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116455
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user