Skip to contentSkip to conversation

Mountstats Fixes

PATCH In review Anna Schumaker 3 participants 7 messages Apr 8, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Mountstats Fixes

I had some trouble using mountstats to analyze READ_PLUS operations, so I wrote these patches to fix my issues.

I found that /proc/self/mountstats was reporting "GETDEVICELIST" as "51", most likely because it was removed from the client but the nfs4_procedures array still has a placeholder for it. Mountstats crashes when it tries to analyze "51", so the second patch fixes this issue by looking for numeric operation names. I'm willing to put in stubs for GETDEVICELIST back into the client if that would be a better fix.

Thanks,
Anna

Anna Schumaker (2):
mountstats: Resync NFSv4 Operations List
mountstats: Only count operations that have names

 tools/mountstats/mountstats.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
Signature · 1 line
2.3.5
#1 lore raw

PATCH 1/2 mountstats: Resync NFSv4 Operations List

We've added several operations and removed GETDEVICELIST, Let's keep the Nfsv4ops list up to date with the kernel.

---
 tools/mountstats/mountstats.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
tools/mountstats/mountstats.py +5 -3
index 38943eb..8f2e26e 100644
@@ -195,16 +195,18 @@ Nfsv4ops = [
     'SEQUENCE',
     'GET_LEASE_TIME',
     'RECLAIM_COMPLETE',
-    'LAYOUTGET',
     'GETDEVICEINFO',
+    'LAYOUTGET',
     'LAYOUTCOMMIT',
     'LAYOUTRETURN',
     'SECINFO_NO_NAME',
     'TEST_STATEID',
     'FREE_STATEID',
-    'GETDEVICELIST',
     'BIND_CONN_TO_SESSION',
-    'DESTROY_CLIENTID'
+    'DESTROY_CLIENTID',
+    'SEEK',
+    'ALLOCATE',
+    'DEALLOCATE',
 ]
 
 class DeviceData:
Signature · 1 line
2.3.5
#2 lore raw

Re: [PATCH 1/2] mountstats: Resync NFSv4 Operations List

Quoted 2 lines · Anna Schumaker

We've added several operations and removed GETDEVICELIST, Let's keep the Nfsv4ops list up to date with the kernel.

Please keep GETDEVICELIST, as newer mountstats should handle older kernels as well.

#3 lore raw

Re: [PATCH 1/2] mountstats: Resync NFSv4 Operations List

Quoted 7 lines · Christoph Hellwig
Quoted 2 lines · Anna Schumaker

We've added several operations and removed GETDEVICELIST, Let's keep the Nfsv4ops list up to date with the kernel.

Please keep GETDEVICELIST, as newer mountstats should handle older kernels as well.

Fair enough. I'm also working on a patch to add GETDEVICELIST back into the client.

Anna

#4 lore raw

PATCH 2/2 mountstats: Only count operations that have names

In reply to Anna Schumaker

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.

---
 tools/mountstats/mountstats.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/mountstats/mountstats.py +3 -2
index 8f2e26e..5f243ac 100644
@@ -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 
Signature · 1 line
2.3.5
#5 lore raw
In reply to Anna Schumaker
Quoted 4 lines · Anna Schumaker

I had some trouble using mountstats to analyze READ_PLUS operations, so I wrote these patches to fix my issues.

I found that /proc/self/mountstats was reporting "GETDEVICELIST" as "51",

Shouldn't we try to fix that as being a regression in the client? I see no reason why we shouldn't be able to add in a p_name for GETDEVICELIST.

Quoted 24 lines

most likely because it was removed from the client but the nfs4_procedures array still has a placeholder for it. Mountstats crashes when it tries to analyze "51", so the second patch fixes this issue by looking for numeric operation names. I'm willing to put in stubs for GETDEVICELIST back into the client if that would be a better fix.

Thanks,
Anna

Anna Schumaker (2):
mountstats: Resync NFSv4 Operations List
mountstats: Only count operations that have names

 tools/mountstats/mountstats.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--
2.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 10 lines · Trond Myklebust
Quoted 4 lines · Anna Schumaker

I had some trouble using mountstats to analyze READ_PLUS operations, so I wrote these patches to fix my issues.

I found that /proc/self/mountstats was reporting "GETDEVICELIST" as "51",

Shouldn't we try to fix that as being a regression in the client? I see no reason why we shouldn't be able to add in a p_name for GETDEVICELIST.

I'm cool with that. I wasn't sure if it fell under "don't break userspace" if I'm the only person to have a problem in however long it's been since GETDEVICELIST was removed.

Anna

Quoted 25 lines
Quoted 25 lines

most likely because it was removed from the client but the nfs4_procedures array still has a placeholder for it. Mountstats crashes when it tries to analyze "51", so the second patch fixes this issue by looking for numeric operation names. I'm willing to put in stubs for GETDEVICELIST back into the client if that would be a better fix.

Thanks,
Anna

Anna Schumaker (2):
mountstats: Resync NFSv4 Operations List
mountstats: Only count operations that have names

 tools/mountstats/mountstats.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--
2.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html