projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
date and time created 82/12/18 15:14:19 by sam
[unix-history]
/
usr
/
src
/
usr.bin
/
netstat
/
mbuf.c
diff --git
a/usr/src/usr.bin/netstat/mbuf.c
b/usr/src/usr.bin/netstat/mbuf.c
index
ee430bc
..
f6a8648
100644
(file)
--- a/
usr/src/usr.bin/netstat/mbuf.c
+++ b/
usr/src/usr.bin/netstat/mbuf.c
@@
-1,5
+1,5
@@
#ifndef lint
#ifndef lint
-static char sccsid[] = "@(#)mbuf.c 4.
2 82/12/05
";
+static char sccsid[] = "@(#)mbuf.c 4.
4 82/12/09
";
#endif
#include <sys/param.h>
#endif
#include <sys/param.h>
@@
-20,20
+20,18
@@
mbpr(mbaddr)
printf("mbstat: symbol not in namelist\n");
return;
}
printf("mbstat: symbol not in namelist\n");
return;
}
- printf("memory utilization:\n");
klseek(kmem, mbaddr, 0);
if (read(kmem, &mbstat, sizeof (mbstat)) != sizeof (mbstat)) {
printf("mbstat: bad read\n");
return;
}
klseek(kmem, mbaddr, 0);
if (read(kmem, &mbstat, sizeof (mbstat)) != sizeof (mbstat)) {
printf("mbstat: bad read\n");
return;
}
- printf("
\t
%d/%d mbufs in use\n", mbstat.m_mbufs - mbstat.m_mbfree,
+ printf("%d/%d mbufs in use\n", mbstat.m_mbufs - mbstat.m_mbfree,
mbstat.m_mbufs);
mbstat.m_mbufs);
- printf("
\t
%d/%d mapped pages in use\n",
+ printf("%d/%d mapped pages in use\n",
mbstat.m_clusters - mbstat.m_clfree, mbstat.m_clusters);
mbstat.m_clusters - mbstat.m_clfree, mbstat.m_clusters);
- printf("
\t
%d requests for memory denied\n", mbstat.m_drops);
+ printf("%d requests for memory denied\n", mbstat.m_drops);
totmem = mbstat.m_mbufs * MSIZE + mbstat.m_clusters * CLBYTES;
totfree = mbstat.m_mbfree * MSIZE + mbstat.m_clusters * CLBYTES;
totmem = mbstat.m_mbufs * MSIZE + mbstat.m_clusters * CLBYTES;
totfree = mbstat.m_mbfree * MSIZE + mbstat.m_clusters * CLBYTES;
- printf("\t%dKbytes allocated to network (%d%% in use)\n",
- totmem / 1024,
- (totmem - totfree + totmem - 1) / totmem);
+ printf("%dKbytes allocated to network (%d%% in use)\n",
+ totmem / 1024, (totmem - totfree) * 100 / totmem);
}
}