date and time created 82/08/25 22:21:46 by sam
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Thu, 26 Aug 1982 13:21:46 +0000 (05:21 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Thu, 26 Aug 1982 13:21:46 +0000 (05:21 -0800)
SCCS-vsn: usr.bin/netstat/mbuf.c 4.1

usr/src/usr.bin/netstat/mbuf.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/netstat/mbuf.c b/usr/src/usr.bin/netstat/mbuf.c
new file mode 100644 (file)
index 0000000..a13a52a
--- /dev/null
@@ -0,0 +1,28 @@
+#ifndef lint
+static char sccsid[] = "@(#)mbuf.c     4.1 82/08/25";
+#endif
+
+#include <sys/types.h>
+#include <sys/mbuf.h>
+
+struct mbstat mbstat;
+extern int kmem;
+
+/*
+ * Print mbuf statistics.
+ */
+mbpr(mbaddr)
+       off_t mbaddr;
+{
+       if (mbaddr == 0) {
+               printf("mbstat: symbol not in namelist\n");
+               return;
+       }
+       printf("mbufs:");
+       klseek(kmem, mbaddr, 0);
+       if (read(kmem, &mbstat, sizeof (mbstat)) == sizeof (mbstat))
+               printf(
+       " mbufs %d mbfree %d clusters %d clfree %d drops %d\n",
+               mbstat.m_mbufs, mbstat.m_mbfree,
+               mbstat.m_clusters, mbstat.m_clfree, mbstat.m_drops);
+}