=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/systat/vmstat.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- src/usr.bin/systat/vmstat.c 1997/12/19 09:34:46 1.14 +++ src/usr.bin/systat/vmstat.c 1998/06/12 22:09:23 1.15 @@ -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 */ /* @@ -463,6 +463,16 @@ while (l-- > 0) 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);