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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

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




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux