From 9d8c45f3dbe2d3027803c7bfe50a0bc3840355ca Mon Sep 17 00:00:00 2001 From: rwatson Date: Sat, 11 Feb 2006 21:27:16 +0000 Subject: Sort sfbuf allocation counters with other sfbuf information. MFC after: 3 days --- usr.bin/netstat/mbuf.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/netstat/mbuf.c b/usr.bin/netstat/mbuf.c index c58b21a..2f76996 100644 --- a/usr.bin/netstat/mbuf.c +++ b/usr.bin/netstat/mbuf.c @@ -162,19 +162,6 @@ mbpr(void *kvmd, u_long mbaddr) printf("%llu mbuf tags in use\n", tag_count); #endif - if (live) { - mlen = sizeof(nsfbufs); - if (!sysctlbyname("kern.ipc.nsfbufs", &nsfbufs, &mlen, NULL, - 0) && - !sysctlbyname("kern.ipc.nsfbufsused", &nsfbufsused, - &mlen, NULL, 0) && - !sysctlbyname("kern.ipc.nsfbufspeak", &nsfbufspeak, - &mlen, NULL, 0)) { - printf("%d/%d/%d sfbufs in use (current/peak/max)\n", - nsfbufsused, nsfbufspeak, nsfbufs); - } - } - /*- * Calculate in-use bytes as: * - straight mbuf memory @@ -223,6 +210,15 @@ mbpr(void *kvmd, u_long mbaddr) packet_failures); if (live) { + mlen = sizeof(nsfbufs); + if (!sysctlbyname("kern.ipc.nsfbufs", &nsfbufs, &mlen, NULL, + 0) && + !sysctlbyname("kern.ipc.nsfbufsused", &nsfbufsused, + &mlen, NULL, 0) && + !sysctlbyname("kern.ipc.nsfbufspeak", &nsfbufspeak, + &mlen, NULL, 0)) + printf("%d/%d/%d sfbufs in use (current/peak/max)\n", + nsfbufsused, nsfbufspeak, nsfbufs); mlen = sizeof(mbstat); if (sysctlbyname("kern.ipc.mbstat", &mbstat, &mlen, NULL, 0)) { warn("kern.ipc.mbstat"); -- cgit v1.1