nfs_iostat.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*
  2. * User-space visible declarations for NFS client per-mount
  3. * point statistics
  4. *
  5. * Copyright (C) 2005, 2006 Chuck Lever <cel@netapp.com>
  6. *
  7. * NFS client per-mount statistics provide information about the
  8. * health of the NFS client and the health of each NFS mount point.
  9. * Generally these are not for detailed problem diagnosis, but
  10. * simply to indicate that there is a problem.
  11. *
  12. * These counters are not meant to be human-readable, but are meant
  13. * to be integrated into system monitoring tools such as "sar" and
  14. * "iostat". As such, the counters are sampled by the tools over
  15. * time, and are never zeroed after a file system is mounted.
  16. * Moving averages can be computed by the tools by taking the
  17. * difference between two instantaneous samples and dividing that
  18. * by the time between the samples.
  19. */
  20. #ifndef _LINUX_NFS_IOSTAT
  21. #define _LINUX_NFS_IOSTAT
  22. #define NFS_IOSTAT_VERS "1.1"
  23. /*
  24. * NFS byte counters
  25. *
  26. * 1. SERVER - the number of payload bytes read from or written
  27. * to the server by the NFS client via an NFS READ or WRITE
  28. * request.
  29. *
  30. * 2. NORMAL - the number of bytes read or written by applications
  31. * via the read(2) and write(2) system call interfaces.
  32. *
  33. * 3. DIRECT - the number of bytes read or written from files
  34. * opened with the O_DIRECT flag.
  35. *
  36. * These counters give a view of the data throughput into and out
  37. * of the NFS client. Comparing the number of bytes requested by
  38. * an application with the number of bytes the client requests from
  39. * the server can provide an indication of client efficiency
  40. * (per-op, cache hits, etc).
  41. *
  42. * These counters can also help characterize which access methods
  43. * are in use. DIRECT by itself shows whether there is any O_DIRECT
  44. * traffic. NORMAL + DIRECT shows how much data is going through
  45. * the system call interface. A large amount of SERVER traffic
  46. * without much NORMAL or DIRECT traffic shows that applications
  47. * are using mapped files.
  48. *
  49. * NFS page counters
  50. *
  51. * These count the number of pages read or written via nfs_readpage(),
  52. * nfs_readpages(), or their write equivalents.
  53. *
  54. * NB: When adding new byte counters, please include the measured
  55. * units in the name of each byte counter to help users of this
  56. * interface determine what exactly is being counted.
  57. */
  58. enum nfs_stat_bytecounters {
  59. NFSIOS_NORMALREADBYTES = 0,
  60. NFSIOS_NORMALWRITTENBYTES,
  61. NFSIOS_DIRECTREADBYTES,
  62. NFSIOS_DIRECTWRITTENBYTES,
  63. NFSIOS_SERVERREADBYTES,
  64. NFSIOS_SERVERWRITTENBYTES,
  65. NFSIOS_READPAGES,
  66. NFSIOS_WRITEPAGES,
  67. __NFSIOS_BYTESMAX,
  68. };
  69. /*
  70. * NFS event counters
  71. *
  72. * These counters provide a low-overhead way of monitoring client
  73. * activity without enabling NFS trace debugging. The counters
  74. * show the rate at which VFS requests are made, and how often the
  75. * client invalidates its data and attribute caches. This allows
  76. * system administrators to monitor such things as how close-to-open
  77. * is working, and answer questions such as "why are there so many
  78. * GETATTR requests on the wire?"
  79. *
  80. * They also count anamolous events such as short reads and writes,
  81. * silly renames due to close-after-delete, and operations that
  82. * change the size of a file (such operations can often be the
  83. * source of data corruption if applications aren't using file
  84. * locking properly).
  85. */
  86. enum nfs_stat_eventcounters {
  87. NFSIOS_INODEREVALIDATE = 0,
  88. NFSIOS_DENTRYREVALIDATE,
  89. NFSIOS_DATAINVALIDATE,
  90. NFSIOS_ATTRINVALIDATE,
  91. NFSIOS_VFSOPEN,
  92. NFSIOS_VFSLOOKUP,
  93. NFSIOS_VFSACCESS,
  94. NFSIOS_VFSUPDATEPAGE,
  95. NFSIOS_VFSREADPAGE,
  96. NFSIOS_VFSREADPAGES,
  97. NFSIOS_VFSWRITEPAGE,
  98. NFSIOS_VFSWRITEPAGES,
  99. NFSIOS_VFSGETDENTS,
  100. NFSIOS_VFSSETATTR,
  101. NFSIOS_VFSFLUSH,
  102. NFSIOS_VFSFSYNC,
  103. NFSIOS_VFSLOCK,
  104. NFSIOS_VFSRELEASE,
  105. NFSIOS_CONGESTIONWAIT,
  106. NFSIOS_SETATTRTRUNC,
  107. NFSIOS_EXTENDWRITE,
  108. NFSIOS_SILLYRENAME,
  109. NFSIOS_SHORTREAD,
  110. NFSIOS_SHORTWRITE,
  111. NFSIOS_DELAY,
  112. NFSIOS_PNFS_READ,
  113. NFSIOS_PNFS_WRITE,
  114. __NFSIOS_COUNTSMAX,
  115. };
  116. /*
  117. * NFS local caching servicing counters
  118. */
  119. enum nfs_stat_fscachecounters {
  120. NFSIOS_FSCACHE_PAGES_READ_OK,
  121. NFSIOS_FSCACHE_PAGES_READ_FAIL,
  122. NFSIOS_FSCACHE_PAGES_WRITTEN_OK,
  123. NFSIOS_FSCACHE_PAGES_WRITTEN_FAIL,
  124. NFSIOS_FSCACHE_PAGES_UNCACHED,
  125. __NFSIOS_FSCACHEMAX,
  126. };
  127. #endif /* _LINUX_NFS_IOSTAT */