2 * User-space visible declarations for NFS client per-mount
5 * Copyright (C) 2005, 2006 Chuck Lever <cel@netapp.com>
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.
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.
21 #ifndef _LINUX_NFS_IOSTAT
22 #define _LINUX_NFS_IOSTAT
24 #define NFS_IOSTAT_VERS "1.0"
29 * 1. SERVER - the number of payload bytes read from or written
30 * to the server by the NFS client via an NFS READ or WRITE
33 * 2. NORMAL - the number of bytes read or written by applications
34 * via the read(2) and write(2) system call interfaces.
36 * 3. DIRECT - the number of bytes read or written from files
37 * opened with the O_DIRECT flag.
39 * These counters give a view of the data throughput into and out
40 * of the NFS client. Comparing the number of bytes requested by
41 * an application with the number of bytes the client requests from
42 * the server can provide an indication of client efficiency
43 * (per-op, cache hits, etc).
45 * These counters can also help characterize which access methods
46 * are in use. DIRECT by itself shows whether there is any O_DIRECT
47 * traffic. NORMAL + DIRECT shows how much data is going through
48 * the system call interface. A large amount of SERVER traffic
49 * without much NORMAL or DIRECT traffic shows that applications
50 * are using mapped files.
54 * These count the number of pages read or written via nfs_readpage(),
55 * nfs_readpages(), or their write equivalents.
57 * NB: When adding new byte counters, please include the measured
58 * units in the name of each byte counter to help users of this
59 * interface determine what exactly is being counted.
61 enum nfs_stat_bytecounters {
62 NFSIOS_NORMALREADBYTES = 0,
63 NFSIOS_NORMALWRITTENBYTES,
64 NFSIOS_DIRECTREADBYTES,
65 NFSIOS_DIRECTWRITTENBYTES,
66 NFSIOS_SERVERREADBYTES,
67 NFSIOS_SERVERWRITTENBYTES,
76 * These counters provide a low-overhead way of monitoring client
77 * activity without enabling NFS trace debugging. The counters
78 * show the rate at which VFS requests are made, and how often the
79 * client invalidates its data and attribute caches. This allows
80 * system administrators to monitor such things as how close-to-open
81 * is working, and answer questions such as "why are there so many
82 * GETATTR requests on the wire?"
84 * They also count anamolous events such as short reads and writes,
85 * silly renames due to close-after-delete, and operations that
86 * change the size of a file (such operations can often be the
87 * source of data corruption if applications aren't using file
90 enum nfs_stat_eventcounters {
91 NFSIOS_INODEREVALIDATE = 0,
92 NFSIOS_DENTRYREVALIDATE,
93 NFSIOS_DATAINVALIDATE,
94 NFSIOS_ATTRINVALIDATE,
102 NFSIOS_VFSWRITEPAGES,
109 NFSIOS_CONGESTIONWAIT,
119 #endif /* _LINUX_NFS_IOSTAT */