From xander@triplex.phaze-III.sec.nl  Tue Oct 12 16:56:16 2004
Return-Path: <xander@triplex.phaze-III.sec.nl>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5563516A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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])
	by triplex.phaze-III.sec.nl (8.12.9p1/8.12.9) with ESMTP id i9CGuCvL006467;
	Tue, 12 Oct 2004 18:56:13 +0200 (CEST)
	(envelope-from xander@triplex.phaze-III.sec.nl)
Received: (from xander@localhost)
	by triplex.phaze-III.sec.nl (8.12.9p1/8.12.9/Submit) id 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 <x+freebsd-gnats@surfnet.nl>
Reply-To: Xander Jansen <x+freebsd-gnats@surfnet.nl>
To: FreeBSD-gnats-submit@freebsd.org
Subject: iostat tty stats field concatenation
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         72588
>Category:       bin
>Synopsis:       [patch] iostat(8) tty stats field concatenation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    keramida
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 12 17:00:47 GMT 2004
>Closed-Date:    Sat May 08 20:03:30 UTC 2010
>Last-Modified:  Sat May 08 20:03:30 UTC 2010
>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:
State-Changed-From-To: open->patched 
State-Changed-By: delphij 
State-Changed-When: Tue Feb 9 22:45:16 UTC 2010 
State-Changed-Why:  
It looks like that the problem gets fixed by revision 196254. 


Responsible-Changed-From-To: freebsd-bugs->keramida 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Tue Feb 9 22:45:16 UTC 2010 
Responsible-Changed-Why:  
Over to keramida@ who did the original commit. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72588 

From: Giorgos Keramidas <keramida@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/72588: iostat tty stats field concatenation
Date: Sat, 08 May 2010 13:58:44 +0300

 Merged to stable/8 as rev 196255.
State-Changed-From-To: patched->closed 
State-Changed-By: keramida 
State-Changed-When: Sat May 8 20:03:02 UTC 2010 
State-Changed-Why:  
Merged from /head to stable/8 and stable/7 

http://www.freebsd.org/cgi/query-pr.cgi?pr=72588 
>Unformatted:
