diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2004-02-15 02:45:48 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2004-02-15 02:45:48 +0000 |
commit | bafaa11c619a93cd4b705e4cca3a65baa2688326 (patch) | |
tree | cab08efe46eb2822ef440f2d84e9c243d779a3a9 /usr.bin/systat | |
parent | 1218bfa7ac931aa5372051060561ce67ec995924 (diff) |
new arg to disk_unbusy, to record separate read/write statistics.
looked at by various, testing henning@ mcbride@ dan weeks
mostly from netbsd via Pedro Martelletto <pbastos@rdc.puc-rio.br>
Diffstat (limited to 'usr.bin/systat')
-rw-r--r-- | usr.bin/systat/iostat.c | 12 | ||||
-rw-r--r-- | usr.bin/systat/vmstat.c | 10 |
2 files changed, 13 insertions, 9 deletions
diff --git a/usr.bin/systat/iostat.c b/usr.bin/systat/iostat.c index e54871e5386..4d636d10f64 100644 --- a/usr.bin/systat/iostat.c +++ b/usr.bin/systat/iostat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iostat.c,v 1.21 2003/06/03 02:56:17 millert Exp $ */ +/* $OpenBSD: iostat.c,v 1.22 2004/02/15 02:45:47 tedu Exp $ */ /* $NetBSD: iostat.c,v 1.5 1996/05/10 23:16:35 thorpej Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)iostat.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: iostat.c,v 1.21 2003/06/03 02:56:17 millert Exp $"; +static char rcsid[] = "$OpenBSD: iostat.c,v 1.22 2004/02/15 02:45:47 tedu Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -252,16 +252,18 @@ stats(int row, int col, int dn) atime = (double)cur.dk_time[dn].tv_sec + ((double)cur.dk_time[dn].tv_usec / (double)1000000); - words = cur.dk_bytes[dn] / 1024.0; /* # of K transferred */ + /* # of K transferred */ + words = (cur.dk_rbytes[dn] + cur.dk_wbytes[dn]) / 1024.0; if (numbers) { mvwprintw(wnd, row, col, "%5.0f%4.0f%5.1f", - words / etime, cur.dk_xfer[dn] / etime, atime / etime); + words / etime, (cur.dk_rxfer[dn] + cur.dk_wxfer[dn]) / + etime, atime / etime); return (row); } wmove(wnd, row++, col); histogram(words / etime, 50, 0.5); wmove(wnd, row++, col); - histogram(cur.dk_xfer[dn] / etime, 50, 0.5); + histogram((cur.dk_rxfer[dn] + cur.dk_wxfer[dn]) / etime, 50, 0.5); if (secs) { wmove(wnd, row++, col); atime *= 1000; /* In milliseconds */ diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 9efe1d1b7cd..eb7bf0266ac 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmstat.c,v 1.43 2003/10/16 07:09:09 mickey Exp $ */ +/* $OpenBSD: vmstat.c,v 1.44 2004/02/15 02:45:47 tedu Exp $ */ /* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; #endif -static char rcsid[] = "$OpenBSD: vmstat.c,v 1.43 2003/10/16 07:09:09 mickey Exp $"; +static char rcsid[] = "$OpenBSD: vmstat.c,v 1.44 2004/02/15 02:45:47 tedu Exp $"; #endif /* not lint */ /* @@ -705,10 +705,12 @@ dinfo(int dn, int c) atime = (double)cur.dk_time[dn].tv_sec + ((double)cur.dk_time[dn].tv_usec / (double)1000000); - words = cur.dk_bytes[dn] / 1024.0; /* # of K transferred */ + /* # of K transferred */ + words = (cur.dk_rbytes[dn] + cur.dk_wbytes[dn]) / 1024.0; putint((int)((float)cur.dk_seek[dn]/etime+0.5), DISKROW + 1, c, 5); - putint((int)((float)cur.dk_xfer[dn]/etime+0.5), DISKROW + 2, c, 5); + putint((int)((float)(cur.dk_rxfer[dn] + cur.dk_wxfer[dn])/etime+0.5), + DISKROW + 2, c, 5); putint((int)(words/etime + 0.5), DISKROW + 3, c, 5); putfloat(atime/etime, DISKROW + 4, c, 5, 1, 1); } |