summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorkn <kn@cvs.openbsd.org>2020-08-21 01:10:08 +0000
committerkn <kn@cvs.openbsd.org>2020-08-21 01:10:08 +0000
commitdc9a6f520320f0ef3db84f470a67adc6026ae307 (patch)
tree9397d2586532e2774a4ba9d4aee2c1f9419215e0 /usr.sbin
parent59318339f85733e21fcc3ac906e87f62b9a566ae (diff)
Fix column spacing for disk transfer speeds
"IO rates above 100 MB/s are common with SSD; this patch expands the column so it stays neatly printed." - report and initial diff from John Carmack, Refinements and adjustment of missing views from me, OK benno
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/iostat/iostat.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c
index 9384c3e47bc..272c3143f3d 100644
--- a/usr.sbin/iostat/iostat.c
+++ b/usr.sbin/iostat/iostat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iostat.c,v 1.42 2019/10/14 19:22:17 deraadt Exp $ */
+/* $OpenBSD: iostat.c,v 1.43 2020/08/21 01:10:07 kn Exp $ */
/* $NetBSD: iostat.c,v 1.10 1996/10/25 18:21:58 scottr Exp $ */
/*
@@ -224,15 +224,12 @@ header(void)
if (ISSET(todo, SHOW_STATS_1))
for (i = 0; i < dk_ndrive; i++)
if (cur.dk_select[i]) {
- if (ISSET(todo, SHOW_TOTALS))
- printf(" %18.18s ", cur.dk_name[i]);
- else
- printf(" %16.16s ", cur.dk_name[i]);
+ printf(" %18.18s ", cur.dk_name[i]);
}
if (ISSET(todo, SHOW_STATS_2))
for (i = 0; i < dk_ndrive; i++)
if (cur.dk_select[i])
- printf(" %16.16s ", cur.dk_name[i]);
+ printf(" %17.17s ", cur.dk_name[i]);
if (ISSET(todo, SHOW_CPU))
printf(" cpu");
@@ -252,12 +249,12 @@ header(void)
if (ISSET(todo, SHOW_TOTALS))
printf(" KB/t xfr MB ");
else
- printf(" KB/t t/s MB/s ");
+ printf(" KB/t t/s MB/s ");
}
if (ISSET(todo, SHOW_STATS_2))
for (i = 0; i < dk_ndrive; i++)
if (cur.dk_select[i])
- printf(" KB xfr time ");
+ printf(" KB xfr time ");
if (ISSET(todo, SHOW_CPU))
printf(" us ni sy sp in id");
@@ -302,7 +299,7 @@ disk_stats(double etime)
if (ISSET(todo, SHOW_TOTALS))
printf(" %6.2f ", mbps / etime);
else
- printf(" %5.2f ", mbps / etime);
+ printf(" %7.2f ", mbps / etime);
}
}
@@ -317,7 +314,7 @@ disk_stats2(double etime)
continue;
/* average kbytes per second. */
- printf(" %6.0f",
+ printf(" %7.0f",
(cur.dk_rbytes[dn] + cur.dk_wbytes[dn]) / (1024.0) / etime);
/* average transfers per second. */