From owner-freebsd-bugs@FreeBSD.ORG Tue Oct 12 17:01:09 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48A7216A4F7 for ; Tue, 12 Oct 2004 17:01:08 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2F09F43D46 for ; Tue, 12 Oct 2004 17:00:48 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i9CH0mAq036654 for ; Tue, 12 Oct 2004 17:00:48 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9CH0mEU036653; Tue, 12 Oct 2004 17:00:48 GMT (envelope-from gnats) Resent-Date: Tue, 12 Oct 2004 17:00:48 GMT Resent-Message-Id: <200410121700.i9CH0mEU036653@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Xander Jansen Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5563516A4CE for ; Tue, 12 Oct 2004 16:56:16 +0000 (GMT) Received: from triplex.phaze-III.sec.nl (154-195.surfsnel.dsl.internl.net [145.99.195.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CD9543D58 for ; Tue, 12 Oct 2004 16:56:15 +0000 (GMT) (envelope-from xander@triplex.phaze-III.sec.nl) Received: from triplex.phaze-III.sec.nl (localhost [127.0.0.1]) i9CGuCvL006467; Tue, 12 Oct 2004 18:56:13 +0200 (CEST) (envelope-from xander@triplex.phaze-III.sec.nl) Received: (from xander@localhost)i9CGu7nO006466; Tue, 12 Oct 2004 18:56:07 +0200 (CEST) (envelope-from xander) Message-Id: <200410121656.i9CGu7nO006466@triplex.phaze-III.sec.nl> Date: Tue, 12 Oct 2004 18:56:07 +0200 (CEST) From: Xander Jansen To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/72588: iostat tty stats field concatenation X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Xander Jansen List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Oct 2004 17:01:09 -0000 >Number: 72588 >Category: bin >Synopsis: iostat tty stats field concatenation >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 12 17:00:47 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Xander >Release: FreeBSD 4.x and 5.x (6.x also I guess) >Organization: Not really >Environment: Noticed on 4.9_REL, 4.10_REL, 5.2.1_REL, problem exists in rev 1.28 and older of iostat.c >Description: With a lot of tty-activity the tty in/out fields in iostat output are printed without separating space. Besides making the output unreadable it also breaks parsing of the output based on whitespace separated fields. The problem is similar to the one in bin/41674 (which contains a fix for the CPU stats). For example: iostat -C -n 0 -c 4 -w 10 tty cpu tin tout us ni sy in id 1 551 1 0 0 0 99 1206250 47 0 3 0 50 <---- 6256600 59 0 4 0 37 <---- 0 227 0 0 0 0 100 >How-To-Repeat: Start a proces sending lots of output to a terminal and have a look at the output of: iostat -C -n 0 -c 10 -w 10 >Fix: Similar to the one in bin/41674. I'm aware that this fix only fixes this particular case and that there might be other printf's to be changed. --- iostat.c.1.28 Sun Mar 16 17:39:52 2003 +++ iostat.c Tue Oct 12 17:48:07 2004 @@ -548,7 +548,7 @@ main(int argc, char **argv) } if (Tflag > 0) - printf("%4.0Lf%5.0Lf", cur.tk_nin / etime, + printf(" %3.0Lf %4.0Lf", cur.tk_nin / etime, cur.tk_nout/etime); devstats(hflag, etime, havelast); >Release-Note: >Audit-Trail: >Unformatted: