@@ -43,7 +43,7 @@ NfsEventCounters = [
'vfspermission',
'vfsupdatepage',
'vfsreadpage',
- 'vfsreadpages',
+ 'vfsreadpages', # or vfsreadahead in statvers=1.2 or above
'vfswritepage',
'vfswritepages',
'vfsreaddir',
@@ -86,7 +86,7 @@ class DeviceData:
self.__nfs_data['export'] = words[1]
self.__nfs_data['mountpoint'] = words[4]
self.__nfs_data['fstype'] = words[7]
- if words[7] == 'nfs':
+ if words[7] == 'nfs' or words[7] == 'nfs4':
self.__nfs_data['statvers'] = words[8]
elif 'nfs' in words or 'nfs4' in words:
self.__nfs_data['export'] = words[0]
@@ -294,8 +294,11 @@ class DeviceData:
print()
print('%d nfs_readpage() calls read %d pages' % \
(vfsreadpage, vfsreadpage))
- print('%d nfs_readpages() calls read %d pages' % \
- (vfsreadpages, pages_read - vfsreadpage))
+ multipageread = "readpages"
+ if float(self.__nfs_data['statvers'].split('=',1)[1]) >= 1.2:
+ multipageread = "readahead"
+ print('%d nfs_%s() calls read %d pages' % \
+ (vfsreadpages, multipageread, pages_read - vfsreadpage))
if vfsreadpages != 0:
print('(%.1f pages per call)' % \
(float(pages_read - vfsreadpage) / vfsreadpages))
Later kernel versions convert NFS readpages to readahead so update the counts accordingly. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> --- tools/nfs-iostat/nfs-iostat.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)