diff options
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r-- | usr.bin/netstat/mbuf.c | 22 |
1 files changed, 9 insertions, 13 deletions
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"); |