summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorsilby <silby@FreeBSD.org>2003-12-27 07:58:31 +0000
committersilby <silby@FreeBSD.org>2003-12-27 07:58:31 +0000
commita7073d4c05871f8b4212047ed36548459124fdef (patch)
treeb8f572c1cdb56d1d5abc39a2ad9428bee0fa3cc4 /usr.bin
parent5c5418dd6e3fd1a458707433f5509baf8876a0ef (diff)
downloadFreeBSD-src-a7073d4c05871f8b4212047ed36548459124fdef.zip
FreeBSD-src-a7073d4c05871f8b4212047ed36548459124fdef.tar.gz
Teach netstat to read and display the new sfbuf statistics.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/mbuf.c12
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,
OpenPOWER on IntegriCloud