diff options
author | silby <silby@FreeBSD.org> | 2003-12-27 07:58:31 +0000 |
---|---|---|
committer | silby <silby@FreeBSD.org> | 2003-12-27 07:58:31 +0000 |
commit | a7073d4c05871f8b4212047ed36548459124fdef (patch) | |
tree | b8f572c1cdb56d1d5abc39a2ad9428bee0fa3cc4 | |
parent | 5c5418dd6e3fd1a458707433f5509baf8876a0ef (diff) | |
download | FreeBSD-src-a7073d4c05871f8b4212047ed36548459124fdef.zip FreeBSD-src-a7073d4c05871f8b4212047ed36548459124fdef.tar.gz |
Teach netstat to read and display the new sfbuf statistics.
-rw-r--r-- | usr.bin/netstat/mbuf.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c index 38a6c93..06fc223 100644 --- a/usr.bin/netstat/mbuf.c +++ b/usr.bin/netstat/mbuf.c @@ -111,6 +111,7 @@ mbpr(u_long mbaddr, u_long mbtaddr __unused, u_long nmbcaddr, u_long nmbufaddr, struct mbpstat **mbpstat = NULL; struct mbtypenames *mp; bool *seen = NULL; + long nsfbufs, nsfbufspeak, nsfbufsused; mlen = sizeof *mbstat; if ((mbstat = malloc(mlen)) == NULL) { @@ -334,6 +335,17 @@ mbpr(u_long mbaddr, u_long mbtaddr __unused, u_long nmbcaddr, u_long nmbufaddr, if (cflag) printf("\t%llu%% of cluster map consumed\n", ((totspace[1] * 100) / (nmbclusters * MCLBYTES))); + + mlen = sizeof(nsfbufs); + if (!sysctlbyname("kern.ipc.nsfbufs", &nsfbufs, &mlen, NULL, NULL) && + !sysctlbyname("kern.ipc.nsfbufsused", &nsfbufsused, &mlen, NULL, + NULL) && + !sysctlbyname("kern.ipc.nsfbufspeak", &nsfbufspeak, &mlen, NULL, + NULL)) { + printf("%i/%i/%i sfbufs in use (current/peak/max)\n", + nsfbufsused, nsfbufspeak, nsfbufs); + } + printf("%llu KBytes allocated to network " "(%lluK mbuf, %lluK mbuf cluster)\n", (totspace[0] + totspace[1]) / 1024, |