1 /* SPDX-License-Identifier: GPL-2.0 */
3 * User-space visible declarations for NFS client per-mount
6 * Copyright (C) 2005, 2006 Chuck Lever <cel@netapp.com>
8 * NFS client per-mount statistics provide information about the
9 * health of the NFS client and the health of each NFS mount point.
10 * Generally these are not for detailed problem diagnosis, but
11 * simply to indicate that there is a problem.
13 * These counters are not meant to be human-readable, but are meant
14 * to be integrated into system monitoring tools such as "sar" and
15 * "iostat". As such, the counters are sampled by the tools over
16 * time, and are never zeroed after a file system is mounted.
17 * Moving averages can be computed by the tools by taking the
18 * difference between two instantaneous samples and dividing that
19 * by the time between the samples.
22 #ifndef _LINUX_NFS_IOSTAT
23 #define _LINUX_NFS_IOSTAT
25 #define NFS_IOSTAT_VERS "1.1"
30 * 1. SERVER - the number of payload bytes read from or written
31 * to the server by the NFS client via an NFS READ or WRITE
34 * 2. NORMAL - the number of bytes read or written by applications
35 * via the read(2) and write(2) system call interfaces.
37 * 3. DIRECT - the number of bytes read or written from files
38 * opened with the O_DIRECT flag.
40 * These counters give a view of the data throughput into and out
41 * of the NFS client. Comparing the number of bytes requested by
42 * an application with the number of bytes the client requests from
43 * the server can provide an indication of client efficiency
44 * (per-op, cache hits, etc).
46 * These counters can also help characterize which access methods
47 * are in use. DIRECT by itself shows whether there is any O_DIRECT
48 * traffic. NORMAL + DIRECT shows how much data is going through
49 * the system call interface. A large amount of SERVER traffic
50 * without much NORMAL or DIRECT traffic shows that applications
51 * are using mapped files.
55 * These count the number of pages read or written via nfs_readpage(),
56 * nfs_readpages(), or their write equivalents.
58 * NB: When adding new byte counters, please include the measured
59 * units in the name of each byte counter to help users of this
60 * interface determine what exactly is being counted.
62 enum nfs_stat_bytecounters
{
63 NFSIOS_NORMALREADBYTES
= 0,
64 NFSIOS_NORMALWRITTENBYTES
,
65 NFSIOS_DIRECTREADBYTES
,
66 NFSIOS_DIRECTWRITTENBYTES
,
67 NFSIOS_SERVERREADBYTES
,
68 NFSIOS_SERVERWRITTENBYTES
,
77 * These counters provide a low-overhead way of monitoring client
78 * activity without enabling NFS trace debugging. The counters
79 * show the rate at which VFS requests are made, and how often the
80 * client invalidates its data and attribute caches. This allows
81 * system administrators to monitor such things as how close-to-open
82 * is working, and answer questions such as "why are there so many
83 * GETATTR requests on the wire?"
85 * They also count anamolous events such as short reads and writes,
86 * silly renames due to close-after-delete, and operations that
87 * change the size of a file (such operations can often be the
88 * source of data corruption if applications aren't using file
91 enum nfs_stat_eventcounters
{
92 NFSIOS_INODEREVALIDATE
= 0,
93 NFSIOS_DENTRYREVALIDATE
,
94 NFSIOS_DATAINVALIDATE
,
95 NFSIOS_ATTRINVALIDATE
,
103 NFSIOS_VFSWRITEPAGES
,
110 NFSIOS_CONGESTIONWAIT
,
123 * NFS local caching servicing counters
125 enum nfs_stat_fscachecounters
{
126 NFSIOS_FSCACHE_PAGES_READ_OK
,
127 NFSIOS_FSCACHE_PAGES_READ_FAIL
,
128 NFSIOS_FSCACHE_PAGES_WRITTEN_OK
,
129 NFSIOS_FSCACHE_PAGES_WRITTEN_FAIL
,
130 NFSIOS_FSCACHE_PAGES_UNCACHED
,
134 #endif /* _LINUX_NFS_IOSTAT */