From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 14 04:37:20 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E74C0106566C for ; Tue, 14 Jul 2009 04:37:20 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 57F598FC22 for ; Tue, 14 Jul 2009 04:37:20 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (adsl129-38.kln.forthnet.gr [77.49.248.38]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-9) with ESMTP id n6E4NDS5030889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 14 Jul 2009 07:23:19 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id n6E4NDPL010023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 14 Jul 2009 07:23:13 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id n6E4NCdT010022; Tue, 14 Jul 2009 07:23:12 +0300 (EEST) (envelope-from keramida@freebsd.org) From: Giorgos Keramidas To: freebsd-hackers@freebsd.org Date: Tue, 14 Jul 2009 07:23:12 +0300 Message-ID: <87d483q4en.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Hellug-MailScanner-ID: n6E4NDS5030889 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.47, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL -0.07, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Subject: can we afford an extra column in iostat? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2009 04:37:21 -0000 While converting my laptop's main disk to zfs, I noticed iostat output like this (bits copied from here and there): | keramida@kobe:/home/keramida$ iostat -w3 ad0 da0 | tty ad0 da0 cpu | tin tout KB/t tps MB/s KB/t tps MB/s us ni sy in id | 5 2119 36.29 56 2.00 54.95 7 0.35 3 0 8 0 89 | 0 9478 10.90 290 3.09 57.22 12 0.67 42 0 43 0 15 | 012595 1.72 213 0.36 21.36 80 1.66 48 0 48 0 4 | 050042 4.56 715 3.19 11.44 164 1.83 29 0 50 1 20 | 11529568 7.34 443 3.17 16.97 165 2.74 31 0 53 0 16 | 33835534 7.61 211 1.57 7.31 295 2.11 36 0 55 1 9 | 38636874 3.10 186 0.56 6.63 309 2.00 37 0 56 0 7 | 24239726 2.54 196 0.49 6.13 336 2.01 36 0 56 0 8 | 17136654 0.57 192 0.11 7.97 305 2.37 34 0 56 0 9 | 23439020 0.76 195 0.15 7.02 333 2.28 32 0 57 1 11 | 43733189 2.52 192 0.47 6.99 269 1.84 37 0 57 1 5 | 36232178 5.48 193 1.03 6.78 268 1.77 38 0 54 0 8 | 43226266 34.19 228 7.61 6.94 253 1.72 32 0 49 1 19 The default output of iostat, when no disks are specified is a bit wider than this, reaching column 75 here: 1 2 3 4 5 6 7 12345678901234567890123456789012345678901234567890123456789012345678901234567890 --------------------------------------------------------------------------- tty ad0 md0 da0 cpu tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in id 6 2315 34.97 58 1.99 6.46 0 0.00 47.41 8 0.37 4 0 8 0 88 But there's still a bit of space before column 80, so can we afford an extra space between tin/tout to make the output look more like this? | $ ./iostat -w2 | tty ad0 md0 da0 cpu | tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in id | 7 2570 32.92 62 1.98 6.46 0 0.00 43.44 10 0.41 4 0 9 0 87 | 0 36506 0.99 507 0.49 0.00 0 0.00 20.13 155 3.04 34 0 56 1 9 | 0 16695 0.83 226 0.18 0.00 0 0.00 26.16 97 2.48 35 0 56 0 9 | 0 24158 10.63 428 4.45 0.00 0 0.00 14.44 137 1.93 32 0 51 0 17 | ^C The patch that changes this is quite small: %%% diff -r 0f182a7399e8 usr.sbin/iostat/iostat.c --- a/usr.sbin/iostat/iostat.c Sun Jul 12 09:34:48 2009 +0300 +++ b/usr.sbin/iostat/iostat.c Tue Jul 14 07:20:41 2009 +0300 @@ -586,7 +586,7 @@ } if (xflag == 0 && Tflag > 0) - printf("%4.0Lf%5.0Lf", cur.tk_nin / etime, + printf("%4.0Lf %5.0Lf", cur.tk_nin / etime, cur.tk_nout / etime); devstats(hflag, etime, havelast); @@ -696,7 +696,7 @@ (void)printf("\n"); if (Tflag > 0) - (void)printf(" tin tout"); + (void)printf(" tin tout"); for (i=0, printed = 0;(i < num_devices) && (printed < maxshowdevs);i++){ if ((dev_select[i].selected != 0) @@ -754,7 +754,7 @@ "device r/i w/i kr/i kw/i wait svc_t %%b " ); if (Tflag > 0) - printf("tin tout "); + printf("tin tout "); if (Cflag > 0) printf("us ni sy in id "); printf("\n"); @@ -895,7 +895,7 @@ */ printf("%52s",""); if (Tflag > 0) - printf("%4.0Lf%5.0Lf", cur.tk_nin / etime, + printf("%4.0Lf %5.0Lf", cur.tk_nin / etime, cur.tk_nout / etime); if (Cflag > 0) cpustats(); %%%