From owner-svn-src-head@FreeBSD.ORG Thu Jul 3 22:08:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61496AD2; Thu, 3 Jul 2014 22:08:38 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id EE7A229D3; Thu, 3 Jul 2014 22:08:37 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 2642A20E7088B; Thu, 3 Jul 2014 22:08:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.3 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id D89DF20E70886; Thu, 3 Jul 2014 22:08:24 +0000 (UTC) Message-ID: <8CE302A118494D52821C3BA2DAA92320@multiplay.co.uk> From: "Steven Hartland" To: "Xin LI" , , , References: <201407032148.s63LmK4B001599@svn.freebsd.org> Subject: Re: svn commit: r268238 - head/usr.sbin/gstat Date: Thu, 3 Jul 2014 23:08:18 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2014 22:08:38 -0000 Great idea thanks for this very useful :) Regards Steve ----- Original Message ----- From: "Xin LI" To: ; ; Sent: Thursday, July 03, 2014 10:48 PM Subject: svn commit: r268238 - head/usr.sbin/gstat > Author: delphij > Date: Thu Jul 3 21:48:19 2014 > New Revision: 268238 > URL: http://svnweb.freebsd.org/changeset/base/268238 > > Log: > Add an option, -p, which makes gstat(8) to only display physical providers > (those with rank of 1). > > MFC after: 2 weeks > > Modified: > head/usr.sbin/gstat/gstat.8 > head/usr.sbin/gstat/gstat.c > > Modified: head/usr.sbin/gstat/gstat.8 > ============================================================================== > --- head/usr.sbin/gstat/gstat.8 Thu Jul 3 20:35:33 2014 (r268237) > +++ head/usr.sbin/gstat/gstat.8 Thu Jul 3 21:48:19 2014 (r268238) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd May 17, 2014 > +.Dd July 3, 2014 > .Dt GSTAT 8 > .Os > .Sh NAME > @@ -32,7 +32,7 @@ > .Nd print statistics about GEOM disks > .Sh SYNOPSIS > .Nm > -.Op Fl abcdo > +.Op Fl abcdop > .Op Fl f Ar filter > .Op Fl I Ar interval > .Sh DESCRIPTION > @@ -84,6 +84,8 @@ or > .Cm us > (the default) indicates that the update interval is specified in > seconds, milliseconds, or microseconds, respectively. > +.It Fl p > +Only display physical providers (those with rank of 1). > .El > .Sh EXIT STATUS > .Ex -std > > Modified: head/usr.sbin/gstat/gstat.c > ============================================================================== > --- head/usr.sbin/gstat/gstat.c Thu Jul 3 20:35:33 2014 (r268237) > +++ head/usr.sbin/gstat/gstat.c Thu Jul 3 21:48:19 2014 (r268238) > @@ -51,7 +51,7 @@ > #include > #include > > -static int flag_a, flag_b, flag_c, flag_d, flag_o; > +static int flag_a, flag_b, flag_c, flag_d, flag_o, flag_p; > static int flag_I = 1000000; > > #define PRINTMSG(...) do { \ > @@ -104,7 +104,7 @@ main(int argc, char **argv) > flag_b = 1; > > f_s[0] = '\0'; > - while ((i = getopt(argc, argv, "abdcf:oI:")) != -1) { > + while ((i = getopt(argc, argv, "abdcf:I:op")) != -1) { > switch (i) { > case 'a': > flag_a = 1; > @@ -143,6 +143,9 @@ main(int argc, char **argv) > i *= 1; > flag_I = i; > break; > + case 'p': > + flag_p = 1; > + break; > case '?': > default: > usage(); > @@ -254,6 +257,9 @@ main(int argc, char **argv) > continue; > if (gid->lg_what == ISCONSUMER && !flag_c) > continue; > + if (flag_p && gid->lg_what == ISPROVIDER && > + ((struct gprovider *)(gid->lg_ptr))->lg_geom->lg_rank != 1) > + continue; > /* Do not print past end of window */ > if (!flag_b) { > getyx(stdscr, cury, curx); > @@ -443,7 +449,7 @@ main(int argc, char **argv) > static void > usage(void) > { > - fprintf(stderr, "usage: gstat [-abcd] [-f filter] [-I interval]\n"); > + fprintf(stderr, "usage: gstat [-abcdp] [-f filter] [-I interval]\n"); > exit(EX_USAGE); > /* NOTREACHED */ > } > >