Date: Tue, 27 Jan 1998 17:50:01 -0800 (PST) From: Jonathan Hanna <pangolin@rogers.wave.ca> To: freebsd-bugs Subject: Re: bin/2973: output of iostat is wrong. Message-ID: <199801280150.RAA10145@hub.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR bin/2973; it has been noted by GNATS.
From: Jonathan Hanna <pangolin@rogers.wave.ca>
To: freebsd-gnats-submit@freebsd.org, tateoka@pdcd.ilab.toshiba.co.jp
Cc: Subject: Re: bin/2973: output of iostat is wrong.
Date: Tue, 27 Jan 1998 17:49:04 -0800 (PST)
I assume the the problem here the numbers running into each other.
This minimal patch has the problem that 100% cpu of some types mess up
column alignment.
--- iostat.c.orig Tue Jan 27 16:45:09 1998
+++ iostat.c Tue Jan 27 17:34:16 1998
@@ -314,7 +314,7 @@
if (etime == 0.0)
etime = 1.0;
etime /= (float)hz;
- (void)printf("%4.0f%5.0f",
+ (void)printf("%4.0f %4.0f",
cur.tk_nin / etime, cur.tk_nout / etime);
dkstats();
cpustats();
@@ -356,10 +356,10 @@
if (!dr_select[dn])
continue;
words = (double)cur.dk_wds[dn] * 32; /* words xfer'd */
- (void)printf("%4.0f", /* sectors */
+ (void)printf(" %3.0f", /* sectors */
words / (DEV_BSIZE / 2) / etime);
- (void)printf("%4.0f", cur.dk_xfer[dn] / etime);
+ (void)printf(" %3.0f", cur.dk_xfer[dn] / etime);
if (dk_wpms[dn] && cur.dk_xfer[dn]) {
atime = cur.dk_time[dn]; /* ticks disk busy */
@@ -372,7 +372,7 @@
msps = itime * 1000 / cur.dk_xfer[dn];
} else
msps = 0;
- (void)printf("%5.1f ", msps);
+ (void)printf(" %4.1f ", msps);
}
}
@@ -386,7 +386,7 @@
for (state = 0; state < CPUSTATES; ++state)
time += cur.cp_time[state];
for (state = 0; state < CPUSTATES; ++state)
- (void)printf("%3.0f",
+ (void)printf(" %2.0f",
100. * cur.cp_time[state] / (time ? time : 1));
}
Jonathan Hanna <pangolin@rogers.wave.ca>
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801280150.RAA10145>
