Blame SOURCES/nfs-utils-2.3.3-nfsiostat-err-cnts.patch

3fbdf3
diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
3fbdf3
index 48ef0964..bda9af67 100755
3fbdf3
--- a/tools/mountstats/mountstats.py
3fbdf3
+++ b/tools/mountstats/mountstats.py
3fbdf3
@@ -308,6 +308,8 @@ class DeviceData:
3fbdf3
             op = words[0][:-1]
3fbdf3
             self.__rpc_data['ops'] += [op]
3fbdf3
             self.__rpc_data[op] = [int(word) for word in words[1:]]
3fbdf3
+            if len(self.__rpc_data[op]) < 9:
3fbdf3
+                self.__rpc_data[op] += [0]
3fbdf3
 
3fbdf3
     def parse_stats(self, lines):
3fbdf3
         """Turn a list of lines from a mount stat file into a 
3fbdf3
@@ -475,7 +477,9 @@ class DeviceData:
3fbdf3
                 retrans = stats[2] - count
3fbdf3
                 if retrans != 0:
3fbdf3
                     print('\t%d retrans (%d%%)' % (retrans, ((retrans * 100) / count)), end=' ')
3fbdf3
-                    print('\t%d major timeouts' % stats[3])
3fbdf3
+                    print('\t%d major timeouts' % stats[3], end='')
3fbdf3
+                if len(stats) >= 10 and stats[9] != 0:
3fbdf3
+                    print('\t%d errors (%d%%)' % (stats[9], ((stats[9] * 100) / count)))
3fbdf3
                 else:
3fbdf3
                     print('')
3fbdf3
                 print('\tavg bytes sent per op: %d\tavg bytes received per op: %d' % \
3fbdf3
@@ -580,7 +584,7 @@ class DeviceData:
3fbdf3
             self.__nfs_data['fstype'] = 'nfs4'
3fbdf3
         self.__rpc_data['ops'] = ops
3fbdf3
         for op in ops:
3fbdf3
-            self.__rpc_data[op] = [0 for i in range(8)]
3fbdf3
+            self.__rpc_data[op] = [0 for i in range(9)]
3fbdf3
 
3fbdf3
     def accumulate_iostats(self, new_stats):
3fbdf3
         """Accumulate counters from all RPC op buckets in new_stats.  This is
3fbdf3
@@ -605,6 +609,8 @@ class DeviceData:
3fbdf3
         queued_for = float(rpc_stats[5])
3fbdf3
         rtt = float(rpc_stats[6])
3fbdf3
         exe = float(rpc_stats[7])
3fbdf3
+        if len(rpc_stats) >= 9:
3fbdf3
+            errs = int(rpc_stats[8])
3fbdf3
 
3fbdf3
         # prevent floating point exceptions
3fbdf3
         if ops != 0:
3fbdf3
@@ -613,12 +619,15 @@ class DeviceData:
3fbdf3
             rtt_per_op = rtt / ops
3fbdf3
             exe_per_op = exe / ops
3fbdf3
             queued_for_per_op = queued_for / ops
3fbdf3
+            if len(rpc_stats) >= 9:
3fbdf3
+                errs_percent = (errs * 100) / ops
3fbdf3
         else:
3fbdf3
             kb_per_op = 0.0
3fbdf3
             retrans_percent = 0.0
3fbdf3
             rtt_per_op = 0.0
3fbdf3
             exe_per_op = 0.0
3fbdf3
             queued_for_per_op = 0.0
3fbdf3
+            errs_percent = 0.0
3fbdf3
 
3fbdf3
         op += ':'
3fbdf3
         print(format(op.lower(), '<16s'), end='')
3fbdf3
@@ -628,7 +637,10 @@ class DeviceData:
3fbdf3
         print(format('retrans', '>16s'), end='')
3fbdf3
         print(format('avg RTT (ms)', '>16s'), end='')
3fbdf3
         print(format('avg exe (ms)', '>16s'), end='')
3fbdf3
-        print(format('avg queue (ms)', '>16s'))
3fbdf3
+        print(format('avg queue (ms)', '>16s'), end='')
3fbdf3
+        if len(rpc_stats) >= 9:
3fbdf3
+            print(format('errors', '>16s'), end='')
3fbdf3
+        print()
3fbdf3
 
3fbdf3
         print(format((ops / sample_time), '>24.3f'), end='')
3fbdf3
         print(format((kilobytes / sample_time), '>16.3f'), end='')
3fbdf3
@@ -637,7 +649,11 @@ class DeviceData:
3fbdf3
         print(format(retransmits, '>16'), end='')
3fbdf3
         print(format(rtt_per_op, '>16.3f'), end='')
3fbdf3
         print(format(exe_per_op, '>16.3f'), end='')
3fbdf3
-        print(format(queued_for_per_op, '>16.3f'))
3fbdf3
+        print(format(queued_for_per_op, '>16.3f'), end='')
3fbdf3
+        if len(rpc_stats) >= 9:
3fbdf3
+            errors = '{0:>10.0f} ({1:>3.1f}%)'.format(errs, errs_percent).strip()
3fbdf3
+            print(format(errors, '>16'), end='')
3fbdf3
+        print()
3fbdf3
 
3fbdf3
     def display_iostats(self, sample_time):
3fbdf3
         """Display NFS and RPC stats in an iostat-like way
3fbdf3
diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
3fbdf3
old mode 100644
3fbdf3
new mode 100755
3fbdf3
index f1556fb7..5b2260ad
3fbdf3
--- a/tools/nfs-iostat/nfs-iostat.py
3fbdf3
+++ b/tools/nfs-iostat/nfs-iostat.py
3fbdf3
@@ -329,6 +329,8 @@ class DeviceData:
3fbdf3
         queued_for = float(rpc_stats[5])
3fbdf3
         rtt = float(rpc_stats[6])
3fbdf3
         exe = float(rpc_stats[7])
3fbdf3
+        if len(rpc_stats) >= 9:
3fbdf3
+            errs = float(rpc_stats[8])
3fbdf3
 
3fbdf3
         # prevent floating point exceptions
3fbdf3
         if ops != 0:
3fbdf3
@@ -337,12 +339,16 @@ class DeviceData:
3fbdf3
             rtt_per_op = rtt / ops
3fbdf3
             exe_per_op = exe / ops
3fbdf3
             queued_for_per_op = queued_for / ops
3fbdf3
+            if len(rpc_stats) >= 9:
3fbdf3
+                errs_percent = (errs * 100) / ops
3fbdf3
         else:
3fbdf3
             kb_per_op = 0.0
3fbdf3
             retrans_percent = 0.0
3fbdf3
             rtt_per_op = 0.0
3fbdf3
             exe_per_op = 0.0
3fbdf3
             queued_for_per_op = 0.0
3fbdf3
+            if len(rpc_stats) >= 9:
3fbdf3
+                errs_percent = 0.0
3fbdf3
 
3fbdf3
         op += ':'
3fbdf3
         print(format(op.lower(), '<16s'), end='')
3fbdf3
@@ -352,7 +358,10 @@ class DeviceData:
3fbdf3
         print(format('retrans', '>16s'), end='')
3fbdf3
         print(format('avg RTT (ms)', '>16s'), end='')
3fbdf3
         print(format('avg exe (ms)', '>16s'), end='')
3fbdf3
-        print(format('avg queue (ms)', '>16s'))
3fbdf3
+        print(format('avg queue (ms)', '>16s'), end='')
3fbdf3
+        if len(rpc_stats) >= 9:
3fbdf3
+            print(format('errors', '>16s'), end='')
3fbdf3
+        print()
3fbdf3
 
3fbdf3
         print(format((ops / sample_time), '>24.3f'), end='')
3fbdf3
         print(format((kilobytes / sample_time), '>16.3f'), end='')
3fbdf3
@@ -361,7 +370,11 @@ class DeviceData:
3fbdf3
         print(format(retransmits, '>16'), end='')
3fbdf3
         print(format(rtt_per_op, '>16.3f'), end='')
3fbdf3
         print(format(exe_per_op, '>16.3f'), end='')
3fbdf3
-        print(format(queued_for_per_op, '>16.3f'))
3fbdf3
+        print(format(queued_for_per_op, '>16.3f'), end='')
3fbdf3
+        if len(rpc_stats) >= 9:
3fbdf3
+            errors = '{0:>10.0f} ({1:>3.1f}%)'.format(errs, errs_percent).strip()
3fbdf3
+            print(format(errors, '>16'), end='')
3fbdf3
+        print()
3fbdf3
 
3fbdf3
     def ops(self, sample_time):
3fbdf3
         sends = float(self.__rpc_data['rpcsends'])
3fbdf3
diff --git a/tools/nfs-iostat/nfsiostat.man b/tools/nfs-iostat/nfsiostat.man
3fbdf3
index 9ae94c5f..940c0431 100644
3fbdf3
--- a/tools/nfs-iostat/nfsiostat.man
3fbdf3
+++ b/tools/nfs-iostat/nfsiostat.man
3fbdf3
@@ -97,6 +97,14 @@ This is the duration from the time the NFS client created the RPC request task t
3fbdf3
 .RE
3fbdf3
 .RE
3fbdf3
 .RE
3fbdf3
+.RS 8
3fbdf3
+- \fBerrors\fR
3fbdf3
+.RS
3fbdf3
+This is the number of operations that completed with an error status (status < 0).  This count is only available on kernels with RPC iostats version 1.1 or above.
3fbdf3
+.RS
3fbdf3
+.RE
3fbdf3
+.RE
3fbdf3
+.RE
3fbdf3
 .TP
3fbdf3
 Note that if an interval is used as argument to \fBnfsiostat\fR, then the diffrence from previous interval will be displayed, otherwise the results will be from the time that the share was mounted.
3fbdf3