bin/112873: [patch] iostat -x should display an unlimited number of devices by default

peter.schuller at infidyne.com peter.schuller at infidyne.com
Tue May 22 21:40:09 UTC 2007


>Number:         112873
>Category:       bin
>Synopsis:       [patch] iostat -x should display an unlimited number of devices by default
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 22 21:40:08 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     peter.schuller at 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 at 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:
>Unformatted:


More information about the freebsd-bugs mailing list