Linux NFS development
 help / color / mirror / Atom feed
From: Anna Schumaker <Anna.Schumaker@netapp.com>
To: <steved@redhat.com>, <linux-nfs@vger.kernel.org>
Cc: <Anna.Schumaker@netapp.com>
Subject: [PATCH 2/2] mountstats: Only count operations that have names
Date: Wed, 8 Apr 2015 12:47:27 -0400	[thread overview]
Message-ID: <1428511647-14920-3-git-send-email-Anna.Schumaker@Netapp.com> (raw)
In-Reply-To: <1428511647-14920-1-git-send-email-Anna.Schumaker@Netapp.com>

GETDEVICELIST was removed from the kernel, but due to the way the client
is coded it still shows up in /proc/self/mountstats as "51".  This
causes mountstats to crash when asked to output "raw" statistics, so
this patch teaches mountsats to ignore any operations that only have
numeric names.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 tools/mountstats/mountstats.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
index 8f2e26e..5f243ac 100644
--- a/tools/mountstats/mountstats.py
+++ b/tools/mountstats/mountstats.py
@@ -284,8 +284,9 @@ class DeviceData:
             self.__rpc_data['per-op'] = words
         else:
             op = words[0][:-1]
-            self.__rpc_data['ops'] += [op]
-            self.__rpc_data[op] = [int(word) for word in words[1:]]
+            if not op.isnumeric():
+                self.__rpc_data['ops'] += [op]
+                self.__rpc_data[op] = [int(word) for word in words[1:]]
 
     def parse_stats(self, lines):
         """Turn a list of lines from a mount stat file into a 
-- 
2.3.5


  parent reply	other threads:[~2015-04-08 16:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 16:47 [PATCH 0/2] Mountstats Fixes Anna Schumaker
2015-04-08 16:47 ` [PATCH 1/2] mountstats: Resync NFSv4 Operations List Anna Schumaker
2015-04-08 17:57   ` Christoph Hellwig
2015-04-08 18:13     ` Anna Schumaker
2015-04-08 16:47 ` Anna Schumaker [this message]
2015-04-08 17:01 ` [PATCH 0/2] Mountstats Fixes Trond Myklebust
2015-04-08 17:53   ` Anna Schumaker

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=1428511647-14920-3-git-send-email-Anna.Schumaker@Netapp.com \
    --to=anna.schumaker@netapp.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox