FreeBSD Bugzilla – Attachment 9732 Details for
Bug 19809
Make mbstat.m_mtypes[] u_long instead of u_short
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.56 KB, created by
iedowse
on 2000-07-09 21:40:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
iedowse
Created:
2000-07-09 21:40:01 UTC
Size:
2.56 KB
patch
obsolete
>Index: sys/kern/uipc_mbuf.c >=================================================================== >RCS file: /home/iedowse/CVS/src/sys/kern/uipc_mbuf.c,v >retrieving revision 1.52 >diff -u -r1.52 uipc_mbuf.c >--- sys/kern/uipc_mbuf.c 2000/07/04 16:35:03 1.52 >+++ sys/kern/uipc_mbuf.c 2000/07/09 17:54:30 >@@ -184,6 +184,7 @@ > p += MSIZE; > } > mbstat.m_mbufs += nmb; >+ mbstat.m_mtypes[MT_FREE] += nmb; > return (1); > } > >Index: sys/sys/mbuf.h >=================================================================== >RCS file: /home/iedowse/CVS/src/sys/sys/mbuf.h,v >retrieving revision 1.51 >diff -u -r1.51 mbuf.h >--- sys/sys/mbuf.h 2000/07/04 16:35:15 1.51 >+++ sys/sys/mbuf.h 2000/07/09 17:55:26 >@@ -191,7 +191,7 @@ > u_long m_drops; /* times failed to find space */ > u_long m_wait; /* times waited for space */ > u_long m_drain; /* times drained protocols for space */ >- u_short m_mtypes[256]; /* type specific mbuf allocations */ >+ u_long m_mtypes[32]; /* type specific mbuf allocations */ > u_long m_mcfail; /* times m_copym failed */ > u_long m_mpfail; /* times m_pullup failed */ > u_long m_msize; /* length of an mbuf */ >Index: usr.bin/netstat/mbuf.c >=================================================================== >RCS file: /home/iedowse/CVS/src/usr.bin/netstat/mbuf.c,v >retrieving revision 1.17 >diff -u -r1.17 mbuf.c >--- usr.bin/netstat/mbuf.c 1999/12/28 06:38:37 1.17 >+++ usr.bin/netstat/mbuf.c 2000/07/09 20:26:37 >@@ -91,8 +91,8 @@ > { 0, 0 } > }; > >-int nmbtypes = sizeof(mbstat.m_mtypes) / sizeof(short); >-bool seen[256]; /* "have we seen this type yet?" */ >+#define NMBTYPES (sizeof(mbstat.m_mtypes) / sizeof(mbstat.m_mtypes[0])) >+bool seen[NMBTYPES]; /* "have we seen this type yet?" */ > > /* > * Print mbuf statistics. >@@ -133,11 +133,6 @@ > #undef MCLBYTES > #define MCLBYTES (mbstat.m_mclbytes) > >- if (nmbtypes != 256) { >- warnx("unexpected change to mbstat; check source"); >- return; >- } >- > totmbufs = 0; > for (mp = mbtypes; mp->mt_name; mp++) > totmbufs += mbstat.m_mtypes[mp->mt_type]; >@@ -146,13 +141,13 @@ > for (mp = mbtypes; mp->mt_name; mp++) > if (mbstat.m_mtypes[mp->mt_type]) { > seen[mp->mt_type] = YES; >- printf("\t%u mbufs allocated to %s\n", >+ printf("\t%lu mbufs allocated to %s\n", > mbstat.m_mtypes[mp->mt_type], mp->mt_name); > } > seen[MT_FREE] = YES; >- for (i = 0; i < nmbtypes; i++) >+ for (i = 0; i < NMBTYPES; i++) > if (!seen[i] && mbstat.m_mtypes[i]) { >- printf("\t%u mbufs allocated to <mbuf type %d>\n", >+ printf("\t%lu mbufs allocated to <mbuf type %d>\n", > mbstat.m_mtypes[i], i); > } > printf("%lu/%lu/%u mbuf clusters in use (current/peak/max)\n",
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 19809
: 9732