diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-02-11 21:27:16 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-02-11 21:27:16 +0000 |
commit | 9d8c45f3dbe2d3027803c7bfe50a0bc3840355ca (patch) | |
tree | d294dcd293129ddd08b0de11221ff152e9f3f70d /usr.bin/netstat/mbuf.c | |
parent | a6ddea17cd613914ae285f229f454d15bd209243 (diff) | |
download | FreeBSD-src-9d8c45f3dbe2d3027803c7bfe50a0bc3840355ca.zip FreeBSD-src-9d8c45f3dbe2d3027803c7bfe50a0bc3840355ca.tar.gz |
Sort sfbuf allocation counters with other sfbuf information.
MFC after: 3 days
Diffstat (limited to 'usr.bin/netstat/mbuf.c')
-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"); |