Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Feb 2001 15:26:59 -0800 (PST)
From:      Yevgeniy Aleynikov <eugenea@go2net.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/25268: vmstat bug
Message-ID:  <Pine.LNX.3.96.1010221152512.17678A-100000@hunches.go2net.com>

next in thread | raw e-mail | index | archive | help

>Number:         25268
>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.3.96.1010221152512.17678A-100000>