From: Steve Dickson <steved@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH 1/2] nfsiostat: Breaks on 3.1 kernels
Date: Wed, 21 Sep 2011 14:16:55 -0400 [thread overview]
Message-ID: <1316629016-27740-2-git-send-email-steved@redhat.com> (raw)
In-Reply-To: <1316629016-27740-1-git-send-email-steved@redhat.com>
nfsiostat depend on all devices entries in /proc/self/mountstats
to start with the word 'device'. With 3.1 kernels, NFS entries
start with the actual device (i.e. server:/export) not
the word 'device'. This change confused nfsiostat parsing.
Signed-off-by: Steve Dickson <steved@redhat.com>
---
tools/nfs-iostat/nfs-iostat.py | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
index 4e55dad..d909632 100644
--- a/tools/nfs-iostat/nfs-iostat.py
+++ b/tools/nfs-iostat/nfs-iostat.py
@@ -86,6 +86,12 @@ class DeviceData:
self.__nfs_data['fstype'] = words[7]
if words[7] == 'nfs':
self.__nfs_data['statvers'] = words[8]
+ elif 'nfs' in words or 'nfs4' in words:
+ self.__nfs_data['export'] = words[0]
+ self.__nfs_data['mountpoint'] = words[3]
+ self.__nfs_data['fstype'] = words[6]
+ if words[6] == 'nfs':
+ self.__nfs_data['statvers'] = words[7]
elif words[0] == 'age:':
self.__nfs_data['age'] = long(words[1])
elif words[0] == 'opts:':
@@ -426,6 +432,9 @@ def parse_stats_file(filename):
if words[0] == 'device':
key = words[4]
new = [ line.strip() ]
+ elif 'nfs' in words or 'nfs4' in words:
+ key = words[3]
+ new = [ line.strip() ]
else:
new += [ line.strip() ]
ms_dict[key] = new
@@ -436,7 +445,6 @@ def parse_stats_file(filename):
def print_iostat_summary(old, new, devices, time, options):
stats = {}
diff_stats = {}
-
if old:
# Trim device list to only include intersection of old and new data,
# this addresses umounts due to autofs mountpoints
@@ -553,7 +561,6 @@ client are listed.
parser.add_option_group(displaygroup)
(options, args) = parser.parse_args(sys.argv)
-
for arg in args:
if arg == sys.argv[0]:
--
1.7.6.2
next prev parent reply other threads:[~2011-09-21 18:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-21 18:16 [PATCH 0/2] Changes in 3.1 kernel break NFS monitoring tools Steve Dickson
2011-09-21 18:16 ` Steve Dickson [this message]
2011-09-21 18:16 ` [PATCH 2/2] mountstats: Breaks on 3.1 kernels Steve Dickson
2011-09-21 18:25 ` [PATCH 0/2] Changes in 3.1 kernel break NFS monitoring tools Bryan Schumaker
2011-09-21 18:31 ` Steve Dickson
2011-09-21 18:51 ` Chuck Lever
2011-09-21 19:03 ` Bryan Schumaker
[not found] ` <4E7A2D70.6000400-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2011-09-21 18:51 ` J. Bruce Fields
2011-09-21 19:31 ` Steve Dickson
2011-09-21 19:34 ` Bryan 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=1316629016-27740-2-git-send-email-steved@redhat.com \
--to=steved@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 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.