commit 3c6ab1854e92467a7309cf244339c6f10c2b0d7d from: Fazlul Shahriar date: Sat Aug 08 20:45:27 2009 UTC stats: make more stats work in Linux http://codereview.appspot.com/96084 commit - 0e9f3966da196eee3353154d7da04fafe90e5644 commit + 3c6ab1854e92467a7309cf244339c6f10c2b0d7d blob - a6f5ba43e1325eb01c24870f2095cbbd7173df92 blob + d5555deb2386cd9d86cf6e871159556ad3541e23 --- man/man1/stats.1 +++ 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. blob - 2592bc4e0ee02036b49548841ccc3329fc95dccf blob + 09ca18f309b651f5a190dfd3fc1aaf03fda443c7 --- src/cmd/auxstats/Linux.c +++ 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