From owner-freebsd-bugs Wed Feb 21 15:30:16 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id D715837B67D for ; Wed, 21 Feb 2001 15:30:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f1LNU1r54070; Wed, 21 Feb 2001 15:30:01 -0800 (PST) (envelope-from gnats) Received: from jack.go2net.com (jack.go2net.com [64.50.65.20]) by hub.freebsd.org (Postfix) with SMTP id 169E037B401 for ; Wed, 21 Feb 2001 15:21:51 -0800 (PST) (envelope-from eugenea@infospace.com) Received: (qmail 37715 invoked from network); 21 Feb 2001 23:25:49 -0000 Received: from ketel.go2net.com (10.200.10.75) by jack.go2net.com with SMTP; 21 Feb 2001 23:25:49 -0000 Received: (qmail 5723 invoked from network); 21 Feb 2001 23:21:50 -0000 Received: from hunches.go2net.com (HELO infospace.com) (@[10.225.33.32]) (envelope-sender ) by ketel.go2net.com (qmail-ldap-1.03) with SMTP for ; 21 Feb 2001 23:21:50 -0000 Message-Id: <3A944D8E.866BB02C@infospace.com> Date: Wed, 21 Feb 2001 15:21:50 -0800 From: Eugene Aleynikov Reply-To: eugene@infospace.com To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/25267: vmstat bug Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25267 >Category: bin >Synopsis: vmstat displays some parameters incorrectly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 21 15:30:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Eugene Aleynikov >Release: FreeBSD 4.2-RELEASE i386 >Organization: Go2net >Environment: 4.2-RELEASE >Description: vmstat displays avm and fre alltogether: # vmstat procs memory page disks faults cpu r b w avm fre flt re pi po fr sr da0 da1 in sy cs us sy id 0 0 0 5404197860 1 0 0 0 1 0 0 0 152 10 3 0 0 100 this makes some monitoring programs go crazy >How-To-Repeat: type vmstat in a command prompt, look at the output >Fix: possible fix is: *** vmstat.c.orig Thu Feb 15 14:58:46 2001 --- vmstat.c Thu Feb 15 15:00:42 2001 *************** *** 482,488 **** total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); #define pgtok(a) ((a) * sum.v_page_size >> 10) #define rate(x) (((x) + halfuptime) / uptime) /* round */ ! (void)printf("%8ld%6ld ", (long)pgtok(total.t_avm), (long)pgtok(total.t_free)); (void)printf("%4lu ", (u_long)rate(sum.v_vm_faults - osum.v_vm_faults)); --- 482,488 ---- total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); #define pgtok(a) ((a) * sum.v_page_size >> 10) #define rate(x) (((x) + halfuptime) / uptime) /* round */ ! (void)printf("%8ld %6ld ", (long)pgtok(total.t_avm), (long)pgtok(total.t_free)); (void)printf("%4lu ", (u_long)rate(sum.v_vm_faults - osum.v_vm_faults)); *************** *** 534,540 **** else if (num_shown == 1) (void)printf("disk"); (void)printf(" faults cpu\n"); ! (void)printf(" r b w avm fre flt re pi po fr sr "); for (i = 0; i < num_devices; i++) if ((dev_select[i].selected) && (dev_select[i].selected <= maxshowdevs)) --- 534,540 ---- else if (num_shown == 1) (void)printf("disk"); (void)printf(" faults cpu\n"); ! (void)printf(" r b w avm fre flt re pi po fr sr "); for (i = 0; i < num_devices; i++) if ((dev_select[i].selected) && (dev_select[i].selected <= maxshowdevs)) >Release-Note: >Audit-Trail: >Unformatted: X-send-pr-version: 3.2 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message