diff --git a/man/man1/stats.1 b/man/man1/stats.1 index a6f5ba43..d5555deb 100644 --- a/man/man1/stats.1 +++ b/man/man1/stats.1 @@ -105,6 +105,11 @@ number of system calls per second. number of valid pages on the swap device. The swap is displayed as a fraction of the number of swap pages configured by the machine. +.TP +.B "8 802.11b +display the signal strength detected by the 802.11b wireless ether card; the value +is usually below 50% unless the receiver is in the same room as the transmitter, so +a midrange value represents a strong signal. .PD .PP The graphs are plotted with time on the horizontal axis. diff --git a/src/cmd/auxstats/Linux.c b/src/cmd/auxstats/Linux.c index 2592bc4e..09ca18f3 100644 --- a/src/cmd/auxstats/Linux.c +++ b/src/cmd/auxstats/Linux.c @@ -8,6 +8,8 @@ void xloadavg(int); void xmeminfo(int); void xnet(int); void xstat(int); +void xvmstat(int); +void xwireless(int); void (*statfn[])(int) = { @@ -16,6 +18,8 @@ void (*statfn[])(int) = xmeminfo, xnet, xstat, + xvmstat, + xwireless, 0 }; @@ -77,6 +81,7 @@ xmeminfo(int first) int i; vlong tot, used; vlong mtot, mfree; + vlong stot, sfree; static int fd = -1; if(first){ @@ -86,6 +91,9 @@ xmeminfo(int first) readfile(fd); mtot = 0; + stot = 0; + mfree = 0; + sfree = 0; for(i=0; i= 3){ @@ -197,11 +216,52 @@ xstat(int first) } */ if(strcmp(tok[0], "intr") == 0) - Bprint(&bout, "interrupt %lld 1000\n", atoll(tok[1])); + Bprint(&bout, "intr %lld 1000\n", atoll(tok[1])); if(strcmp(tok[0], "ctxt") == 0) - Bprint(&bout, "context %lld 1000\n", atoll(tok[1])); + Bprint(&bout, "context %lld 10000\n", atoll(tok[1])); if(strcmp(tok[0], "processes") == 0) Bprint(&bout, "fork %lld 1000\n", atoll(tok[1])); } } +void +xvmstat(int first) +{ + static int fd = -1; + int i; + + if(first){ + fd = open("/proc/vmstat", OREAD); + return; + } + + readfile(fd); + for(i=0; i