Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/usr.sbin/iostat Pull up following revision(s) (requested ...



details:   https://anonhg.NetBSD.org/src/rev/14d246ff8781
branches:  netbsd-7
changeset: 799680:14d246ff8781
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Nov 08 00:49:05 2015 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1016):
        usr.sbin/iostat/iostat.c: revision 1.62
        usr.sbin/iostat/iostat.c: revision 1.63
        usr.sbin/iostat/iostat.8: revision 1.24
support fnmatch(3) patterns for disknames.  eg, "iostat wd*" works now.
update the default disk number selection to note that it uses the current
terminal size to fit disks, not hard coded 4.
extend the "tout" column to 5 characters, it's really common on a modern
machine to have eg, build output way more than 9999 chars/sec.
this doesn't affect the default disk list on an 80-char wide screen.

diffstat:

 usr.sbin/iostat/iostat.8 |  16 ++++++++++------
 usr.sbin/iostat/iostat.c |  13 +++++++------
 2 files changed, 17 insertions(+), 12 deletions(-)

diffs (109 lines):

diff -r 9dc90eaea397 -r 14d246ff8781 usr.sbin/iostat/iostat.8
--- a/usr.sbin/iostat/iostat.8  Sun Nov 08 00:45:22 2015 +0000
+++ b/usr.sbin/iostat/iostat.8  Sun Nov 08 00:49:05 2015 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: iostat.8,v 1.23 2014/06/11 17:01:04 joerg Exp $
+.\"    $NetBSD: iostat.8,v 1.23.2.1 2015/11/08 00:49:06 riz Exp $
 .\"
 .\" Copyright (c) 1985, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"    from: @(#)iostat.8      8.1 (Berkeley) 6/6/93
 .\"
-.Dd June 11, 2014
+.Dd July 9, 2015
 .Dt IOSTAT 8
 .Os
 .Sh NAME
@@ -142,13 +142,16 @@
 .It disks
 Disk operations.
 The header of the field is the disk name and unit number.
-If more than four disk drives are configured in the system,
+If more drives are configured in the system that fit across the
+current display,
 .Nm
-displays only the first four drives.
+displays only those drives that fit on the display.
 To force
 .Nm
-to display specific drives, their names may be supplied on the command
-line.
+to display specific drives, they may be supplied on the command
+line, either as names or
+.Fn fnmatch
+patterns.
 .Pp
 .Bl -tag -width indent -compact
 .It KB/t
@@ -189,6 +192,7 @@
 .Xr \&ps 1 ,
 .Xr systat 1 ,
 .Xr vmstat 1 ,
+.Xr fnmatch 3 ,
 .Xr pstat 8
 .Pp
 The sections starting with ``Interpreting system activity'' in
diff -r 9dc90eaea397 -r 14d246ff8781 usr.sbin/iostat/iostat.c
--- a/usr.sbin/iostat/iostat.c  Sun Nov 08 00:45:22 2015 +0000
+++ b/usr.sbin/iostat/iostat.c  Sun Nov 08 00:49:05 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iostat.c,v 1.61 2014/06/11 17:01:04 joerg Exp $        */
+/*     $NetBSD: iostat.c,v 1.61.2.1 2015/11/08 00:49:05 riz Exp $      */
 
 /*
  * Copyright (c) 1996 John M. Vinopal
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = "@(#)iostat.c   8.3 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: iostat.c,v 1.61 2014/06/11 17:01:04 joerg Exp $");
+__RCSID("$NetBSD: iostat.c,v 1.61.2.1 2015/11/08 00:49:05 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -88,6 +88,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <math.h>
+#include <fnmatch.h>
 
 #include "drvstats.h"
 
@@ -183,7 +184,7 @@
        if (ISSET(todo, SHOW_CPU))
                defdrives -= 16;        /* XXX magic number */
        if (ISSET(todo, SHOW_TTY))
-               defdrives -= 9;         /* XXX magic number */
+               defdrives -= 10;        /* XXX magic number */
        defdrives /= 18;                /* XXX magic number */
 
        drvinit(0);
@@ -278,7 +279,7 @@
 
                                        /* Sub-Headers. */
        if (ISSET(todo, SHOW_TTY))
-               printf(" tin tout");
+               printf(" tin  tout");
 
        if (ISSET(todo, SHOW_STATS_1)) {
                for (i = 0; i < ndrive; i++)
@@ -467,7 +468,7 @@
        }
 
        if (ISSET(todo, SHOW_TTY))
-               printf("%4.0f %4.0f", cur.tk_nin / etime, cur.tk_nout / etime);
+               printf("%4.0f %5.0f", cur.tk_nin / etime, cur.tk_nout / etime);
 
        if (ISSET(todo, SHOW_STATS_1)) {
                drive_stats(etime);
@@ -511,7 +512,7 @@
 #endif
                tried++;
                for (i = 0; i < (int)ndrive; i++) {
-                       if (strcmp(cur.name[i], *argv))
+                       if (fnmatch(*argv, cur.name[i], 0))
                                continue;
                        cur.select[i] = 1;
                        ++ndrives;



Home | Main Index | Thread Index | Old Index