summaryrefslogtreecommitdiffstats
path: root/release/picobsd/tinyware
diff options
context:
space:
mode:
authorabial <abial@FreeBSD.org>1998-10-29 12:38:06 +0000
committerabial <abial@FreeBSD.org>1998-10-29 12:38:06 +0000
commitc0343e59cb998d27704ffcc4957b46622392ee2b (patch)
tree1f47966c511746736317a4521028fb0f038336e9 /release/picobsd/tinyware
parent9a84781068032b4b52586ff65ba49300f5d2a64e (diff)
downloadFreeBSD-src-c0343e59cb998d27704ffcc4957b46622392ee2b.zip
FreeBSD-src-c0343e59cb998d27704ffcc4957b46622392ee2b.tar.gz
Fix conversion from pages to kB's.
Noticed by: luigi Obtained from: sources for vmstat(8)
Diffstat (limited to 'release/picobsd/tinyware')
-rw-r--r--release/picobsd/tinyware/vm/vm.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/release/picobsd/tinyware/vm/vm.c b/release/picobsd/tinyware/vm/vm.c
index 710cfb9..cd74495 100644
--- a/release/picobsd/tinyware/vm/vm.c
+++ b/release/picobsd/tinyware/vm/vm.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: vm.c,v 1.1.1.1 1998/07/14 07:30:54 abial Exp $
+ * $Id: vm.c,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $
*/
#include <stdio.h>
@@ -32,6 +32,8 @@
#include <sys/vmmeter.h>
#include <vm/vm_param.h>
+#define pgtok(a) ((a) * (u_int) DEFAULT_PAGE_SIZE >> 10)
+
int
main(int argc, char *argv[])
{
@@ -44,14 +46,17 @@ main(int argc, char *argv[])
for(;;) {
sysctl(mib,2,&v,&len,NULL,0);
if(i==0) {
- printf(" procs kB virt mem real mem shared vm shared real free\n");
- printf(" r d p s tot act tot act tot act tot act\n");
+ printf(" procs kB virt mem real mem shared vm shared real free\n");
+ printf(" r w l s tot act tot act tot act tot act\n");
}
- printf("%2hu%2hu%2hu%2hu",v.t_rq,v.t_dw,v.t_pw,v.t_sl);
- printf("%7u%7u%7u%7u",
- v.t_vm<<2,v.t_avm<<2,v.t_rm<<2,v.t_arm<<2);
- printf("%7u%7u%7u%7u%7u\n",
- v.t_vmshr<<2,v.t_avmshr<<2,v.t_rmshr<<2,v.t_armshr<<2,v.t_free<<2);
+ printf("%2hu%2hu%2hu%2hu",v.t_rq-1,v.t_dw+v.t_pw,v.t_sl,v.t_sw);
+ printf("%7ld %7ld %7ld%7ld",
+ (long)pgtok(v.t_vm),(long)pgtok(v.t_avm),
+ (long)pgtok(v.t_rm),(long)pgtok(v.t_arm));
+ printf("%7ld%7ld%7ld%7ld%7ld\n",
+ (long)pgtok(v.t_vmshr),(long)pgtok(v.t_avmshr),
+ (long)pgtok(v.t_rmshr),(long)pgtok(v.t_armshr),
+ (long)pgtok(v.t_free));
sleep(5);
i++;
if(i>22) i=0;
OpenPOWER on IntegriCloud