From: Steve Dickson <SteveD@RedHat.com>
To: Dave Wysochanski <dwysocha@redhat.com>, chuck.lever@oracle.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] mountstats: Fix nfsstat command to handle RPC iostats version >= 1.1
Date: Thu, 1 Aug 2019 12:13:13 -0400 [thread overview]
Message-ID: <d55ee4a1-e4f9-afac-b750-636645cb2584@RedHat.com> (raw)
In-Reply-To: <20190626170259.8347-1-dwysocha@redhat.com>
On 6/26/19 1:02 PM, Dave Wysochanski wrote:
> Later kernels with RPC iostats version >= 1.1 have an additional errors
> count for each op. Lengthen the array of values created inside
> DeviceData and then in __parse_rpc_line just zero this value out for
> prior kernels where this count is not present. The count is not used
> for nfsstat, but this keeps DeviceData consistent with the new count
> as well as proper functioning of accumulate_iostats.
>
> Before this patch, nfsstat will backtrace on a kernel with RPC iostats
> version >= 1.1 due to the fixed array inside DeviceData. This patch
> fixes this backtrace and also allows nfsstat to work with these new
> kernels.
>
> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Committed...
steved
> ---
> tools/mountstats/mountstats.py | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
> index c5e8f506..6ac83ccb 100755
> --- a/tools/mountstats/mountstats.py
> +++ b/tools/mountstats/mountstats.py
> @@ -308,6 +308,8 @@ class DeviceData:
> op = words[0][:-1]
> self.__rpc_data['ops'] += [op]
> self.__rpc_data[op] = [int(word) for word in words[1:]]
> + if len(self.__rpc_data[op]) < 9:
> + self.__rpc_data[op] += [0]
>
> def parse_stats(self, lines):
> """Turn a list of lines from a mount stat file into a
> @@ -582,7 +584,7 @@ class DeviceData:
> self.__nfs_data['fstype'] = 'nfs4'
> self.__rpc_data['ops'] = ops
> for op in ops:
> - self.__rpc_data[op] = [0 for i in range(8)]
> + self.__rpc_data[op] = [0 for i in range(9)]
>
> def accumulate_iostats(self, new_stats):
> """Accumulate counters from all RPC op buckets in new_stats. This is
>
prev parent reply other threads:[~2019-08-01 16:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 17:02 [PATCH] mountstats: Fix nfsstat command to handle RPC iostats version >= 1.1 Dave Wysochanski
2019-08-01 16:13 ` Steve Dickson [this message]
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=d55ee4a1-e4f9-afac-b750-636645cb2584@RedHat.com \
--to=steved@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=dwysocha@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox