summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorScott Soule Cheloha <cheloha@cvs.openbsd.org>2022-12-28 20:49:06 +0000
committerScott Soule Cheloha <cheloha@cvs.openbsd.org>2022-12-28 20:49:06 +0000
commit9aa4735415cc3c67eef520cb98a02e3471ce2798 (patch)
tree871ea14c5eceec967dd9dcf832f6811bb4017a52 /usr.bin
parent84872315409f9379316463dd4bf386f03595eadd (diff)
systat(1): vmstat: dinfo(): compute rates using real elapsed time
The "naptime" value is not the real elapsed time. But showkre() has the real elapsed time, "etime", so pass that as argument to dinfo(). Link: https://marc.info/?l=openbsd-tech&m=167095169115427&w=2 ok millert@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/vmstat.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index 9cb43279199..243daf7056b 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmstat.c,v 1.95 2022/12/04 18:01:57 cheloha Exp $ */
+/* $OpenBSD: vmstat.c,v 1.96 2022/12/28 20:49:05 cheloha Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
@@ -84,7 +84,7 @@ static enum state { BOOT, TIME, RUN } state = TIME;
static void allocinfo(struct Info *);
static void copyinfo(struct Info *, struct Info *);
static float cputime(int);
-static void dinfo(int, int);
+static void dinfo(int, int, double);
static void getinfo(struct Info *);
void putint(int, int, int, int);
void putintmk(int, int, int, int);
@@ -443,7 +443,7 @@ showkre(void)
mvprintw(DISKROW, DISKCOL + 5 + c,
" %*s", l, dr_name[i]);
c += 1 + l;
- dinfo(i, c);
+ dinfo(i, c, etime);
}
/* and pad the DRIVESPACE */
l = DRIVESPACE - c;
@@ -666,11 +666,9 @@ copyinfo(struct Info *from, struct Info *to)
}
static void
-dinfo(int dn, int c)
+dinfo(int dn, int c, double etime)
{
- double words, atime, etime;
-
- etime = naptime;
+ double words, atime;
c += DISKCOL;