diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 1998-06-12 22:09:24 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 1998-06-12 22:09:24 +0000 |
commit | 1bc7e4b5fc117f06497f8106487b7f034b6ca9cf (patch) | |
tree | a3990220f2e57ba2db525f934688da5e0385ebca /usr.bin/systat/vmstat.c | |
parent | 68a926cb06053dc27515cc7d6154a387940d9ce4 (diff) |
fix vm load display
Diffstat (limited to 'usr.bin/systat/vmstat.c')
-rw-r--r-- | usr.bin/systat/vmstat.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 2c5c5aa521e..b556e7653c1 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmstat.c,v 1.14 1997/12/19 09:34:46 deraadt Exp $ */ +/* $OpenBSD: vmstat.c,v 1.15 1998/06/12 22:09:23 marc Exp $ */ /* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; #endif -static char rcsid[] = "$OpenBSD: vmstat.c,v 1.14 1997/12/19 09:34:46 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: vmstat.c,v 1.15 1998/06/12 22:09:23 marc Exp $"; #endif /* not lint */ /* @@ -464,6 +464,16 @@ showkre() addch(cpuchar[c]); } + /* + * The above code does not account for time in the CP_INTR state. + * Thus the total may be less than 100%. If the total is less than + * the previous total old data may be left on the graph. The graph + * assumes one character position for every 2 percentage points for + * a total of 50 positions. Ensure all positions have been filled. + */ + while ( psiz++ <= 50 ) + addch(' '); + putint(ucount(), STATROW, STATCOL, 3); putfloat(avenrun[0], STATROW, STATCOL + 17, 6, 2, 0); putfloat(avenrun[1], STATROW, STATCOL + 23, 6, 2, 0); |