From root@scode.mine.nu  Tue May 22 21:39:27 2007
Return-Path: <root@scode.mine.nu>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id 80A9C16A41F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 22 May 2007 21:39:27 +0000 (UTC)
	(envelope-from root@scode.mine.nu)
Received: from mxfep04.bredband.com (mxfep04.bredband.com [195.54.107.79])
	by mx1.freebsd.org (Postfix) with ESMTP id CD0D213C448
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 22 May 2007 21:39:26 +0000 (UTC)
	(envelope-from root@scode.mine.nu)
Received: from ironport.bredband.com ([195.54.107.82] [195.54.107.82])
          by mxfep02.bredband.com with ESMTP
          id <20070522205608.BVOH25484.mxfep02.bredband.com@ironport.bredband.com>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Tue, 22 May 2007 22:56:08 +0200
Received: from c-5416e555.03-51-73746f3.cust.bredbandsbolaget.se (HELO scode.mine.nu) ([85.229.22.84])
  by ironport.bredband.com with ESMTP; 22 May 2007 22:56:08 +0200
Received: by scode.mine.nu (Postfix, from userid 0)
	id 6607EC711; Tue, 22 May 2007 22:56:07 +0200 (CEST)
Message-Id: <20070522205607.6607EC711@scode.mine.nu>
Date: Tue, 22 May 2007 22:56:07 +0200 (CEST)
From: peter.schuller@infidyne.com
Reply-To: peter.schuller@infidyne.com
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] iostat -x should display an unlimited number of devices by default
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         112873
>Category:       bin
>Synopsis:       [patch] iostat(8): iostat -x should display an unlimited number of devices by default
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 22 21:40:08 GMT 2007
>Closed-Date:    Tue Jan 15 07:54:28 UTC 2008
>Last-Modified:  Tue Jan 15 07:54:28 UTC 2008
>Originator:     peter.schuller@infidyne.com
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD scode.mine.nu 7.0-CURRENT FreeBSD 7.0-CURRENT #1: Fri May 18 12:15:20 CEST 2007 toor@scode.mine.nu:/zpromusr/obj/zpromusr/src/sys/PROMETHEUS i386

>Description:
I do not think the default maximum device count, designed for 80 column
display in non-extended mode output, makes any sense in extended mode.  I
believe a better default is to display all devices by default given the
relative vertical size of your typical termianl vs. the number of devices
in a machine.

If you have so many devices that a normal sized terminal window/console does
not fit them, or if you have an extremely small terminal window, that feels
sufficiently abnormal to warrant not catering to it by default.
>How-To-Repeat:
>Fix:

--- usr.sbin/iostat/iostat.c.orig	Tue May 22 22:36:31 2007
+++ usr.sbin/iostat/iostat.c	Tue May 22 22:41:41 2007
@@ -285,7 +285,9 @@
 	 * Figure out how many devices we should display.
 	 */
 	if (nflag == 0) {
-		if (oflag > 0) {
+		if (xflag > 0) {
+			maxshowdevs = INT_MAX;
+		} else if (oflag > 0) {
 			if ((dflag > 0) && (Cflag == 0) && (Tflag == 0))
 				maxshowdevs = 5;
 			else if ((dflag > 0) && (Tflag > 0) && (Cflag == 0))
--- usr.sbin/iostat/iostat.8.orig	Tue May 22 22:36:36 2007
+++ usr.sbin/iostat/iostat.8	Tue May 22 22:47:20 2007
@@ -226,7 +226,8 @@
 argument will be included in the
 .Nm
 output, up to the number of devices that can be displayed in
-80 columns, or the maximum number of devices specified by the user.
+80 columns, the maximum number of devices specified by the user,
+or an unlimted amount in extended mode.
 .It Fl T
 Display TTY statistics.
 This is on by default, unless
@@ -242,6 +243,9 @@
 .It Fl x
 Show extended disk statistics.
 Each disk is displayed on a line of its own with all available statistics.
+Unless
+.Fl n
+is specified, there will be no limit on the number of devices displayed.
 .It Fl z
 If
 .Fl x


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Tue Jan 15 07:52:36 UTC 2008 
State-Changed-Why:  
A little bit different code was committed to 7.0.  Thanks 
for the PR. 

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