All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Banks <gnb@sgi.com>
To: Kevin Constantine
	<Kevin.Constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
Cc: linux-nfs@vger.kernel.org, steved@redhat.com,
	Kevin Constantine
	<Kevin.Constantine-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 1/2] nfsstat.c: Print diff stats every N seconds
Date: Tue, 17 Mar 2009 15:03:37 +1100	[thread overview]
Message-ID: <49BF2119.8060600@sgi.com> (raw)
In-Reply-To: <1237225556-27691-1-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>

Kevin Constantine wrote:
> nfsstat.c: Implemented --sleep[interval] option.
> nfsstat.man: Added information about the --sleep option
> Signed-off-by: Kevin Constantine <kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
> ---
>  utils/nfsstat/nfsstat.c   |  158 +++++++++++++++++++++++++++++++++++++--------
>  utils/nfsstat/nfsstat.man |    6 ++-
>  2 files changed, 137 insertions(+), 27 deletions(-)
>
> diff --git a/utils/nfsstat/nfsstat.c b/utils/nfsstat/nfsstat.c
> index 1517414..c25580c 100644
> --- a/utils/nfsstat/nfsstat.c
> +++ b/utils/nfsstat/nfsstat.c
> @@ -167,10 +167,16 @@ DECLARE_SRV(srvinfo, _old);
> @@ -183,6 +189,7 @@ static void		get_stats(const char *, struct statinfo *, int *, int,
> @@ -207,26 +214,29 @@ void usage(char *name)
> @@ -245,7 +255,7 @@ static struct option longopts[] =
> @@ -258,6 +268,7 @@ main(int argc, char **argv)
> @@ -279,7 +290,7 @@ main(int argc, char **argv)
> @@ -311,6 +322,9 @@ main(int argc, char **argv)
> @@ -384,7 +398,7 @@ main(int argc, char **argv)
>   

All good.
> @@ -404,7 +418,33 @@ main(int argc, char **argv)
>  			diff_stats(clientinfo_tmp, clientinfo, 0);
>  		}
>  	}
> +	if(sleep_time) {
> +		while(1) {
> +			if (opt_srv) {
> +				get_stats(NFSSRVSTAT, serverinfo_tmp , &opt_srv, opt_clt, 1);
> +				diff_stats(serverinfo_tmp, serverinfo, 1);
> +			}
> +			if (opt_clt) {
> +				get_stats(NFSCLTSTAT, clientinfo_tmp, &opt_clt, opt_srv, 0);
> +				diff_stats(clientinfo_tmp, clientinfo, 0);
> +			}
> +			print_stats_list(opt_prt);
> +			fflush(stdout);
> +
> +			update_old_counters(clientinfo_tmp, clientinfo);
> +			sleep(sleep_time);
> +		}	
> +	} else {
> +		print_server_stats(opt_srv, opt_prt);
> +		print_client_stats(opt_clt, opt_prt);
> +	}
> +
>   
So what I expected to see here, was both the sleep_time != 0 and
sleep_time == 0 cases calling the same function which printed stats in
the old format.  Then the next patch could add the --list option which
added a new feature to that function.  In other words,
print_stats_list() would be introduced in the 2nd patch.

> @@ -479,7 +519,10 @@ main(int argc, char **argv)
> @@ -515,10 +558,43 @@ main(int argc, char **argv)
> @@ -569,6 +645,26 @@ print_callstats(const char *hdr, const char **names,
> @@ -846,3 +942,13 @@ unpause(int sig)
> diff --git a/utils/nfsstat/nfsstat.man b/utils/nfsstat/nfsstat.man
> index cb5f89f..461b2c0 100644
> --- a/utils/nfsstat/nfsstat.man
> +++ b/utils/nfsstat/nfsstat.man
> @@ -91,7 +91,7 @@ output
>
>   
The manpage change looks fine.

-- 
Greg Banks, P.Engineer, SGI Australian Software Group.
the brightly coloured sporks of revolution.
I don't speak for SGI.


  parent reply	other threads:[~2009-03-17  3:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16 17:45 [PATCH 1/2] nfsstat.c: Print diff stats every N seconds Kevin Constantine
     [not found] ` <1237225556-27691-1-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-03-16 17:45   ` [PATCH 2/2] nfsstat: Add --list flag Kevin Constantine
     [not found]     ` <1237225556-27691-2-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-03-17  4:18       ` Greg Banks
2009-03-17  7:46         ` [PATCH 1/2] nfsstat: Print diff stats every N seconds Kevin Constantine
     [not found]           ` <1237275989-16421-1-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-03-17  7:46             ` [PATCH 2/2] nfsstat: Add --list flag Kevin Constantine
     [not found]               ` <1237275989-16421-2-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-03-18  2:43                 ` Greg Banks
2009-03-18  2:43             ` [PATCH 1/2] nfsstat: Print diff stats every N seconds Greg Banks
2009-03-17 12:15         ` [PATCH 2/2] nfsstat: Add --list flag Steve Dickson
     [not found]           ` <49BF9460.4050108-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-03-17 16:16             ` Frank Filz
2009-03-17 16:33             ` Kevin Constantine
2009-03-17  4:03   ` Greg Banks [this message]
2009-04-03 15:26   ` [PATCH 1/2] nfsstat.c: Print diff stats every N seconds Steve Dickson
     [not found]     ` <49D62A92.5090907-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-04-03 17:10       ` Kevin Constantine
     [not found]         ` <49D642F7.3040900-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
2009-04-03 18:20           ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49BF2119.8060600@sgi.com \
    --to=gnb@sgi.com \
    --cc=Kevin.Constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org \
    --cc=Kevin.Constantine-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.