brintos

brintos / linux-shallow public Read only

0
0
Text · 3.9 KiB · 8d94608 Raw
123 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/*3 *  User-space visible declarations for NFS client per-mount4 *  point statistics5 *6 *  Copyright (C) 2005, 2006 Chuck Lever <cel@netapp.com>7 *8 *  NFS client per-mount statistics provide information about the9 *  health of the NFS client and the health of each NFS mount point.10 *  Generally these are not for detailed problem diagnosis, but11 *  simply to indicate that there is a problem.12 *13 *  These counters are not meant to be human-readable, but are meant14 *  to be integrated into system monitoring tools such as "sar" and15 *  "iostat".  As such, the counters are sampled by the tools over16 *  time, and are never zeroed after a file system is mounted.17 *  Moving averages can be computed by the tools by taking the18 *  difference between two instantaneous samples  and dividing that19 *  by the time between the samples.20 */21 22#ifndef _LINUX_NFS_IOSTAT23#define _LINUX_NFS_IOSTAT24 25#define NFS_IOSTAT_VERS		"1.1"26 27/*28 * NFS byte counters29 *30 * 1.  SERVER - the number of payload bytes read from or written31 *     to the server by the NFS client via an NFS READ or WRITE32 *     request.33 *34 * 2.  NORMAL - the number of bytes read or written by applications35 *     via the read(2) and write(2) system call interfaces.36 *37 * 3.  DIRECT - the number of bytes read or written from files38 *     opened with the O_DIRECT flag.39 *40 * These counters give a view of the data throughput into and out41 * of the NFS client.  Comparing the number of bytes requested by42 * an application with the number of bytes the client requests from43 * the server can provide an indication of client efficiency44 * (per-op, cache hits, etc).45 *46 * These counters can also help characterize which access methods47 * are in use.  DIRECT by itself shows whether there is any O_DIRECT48 * traffic.  NORMAL + DIRECT shows how much data is going through49 * the system call interface.  A large amount of SERVER traffic50 * without much NORMAL or DIRECT traffic shows that applications51 * are using mapped files.52 *53 * NFS page counters54 *55 * These count the number of pages read or written via nfs_readpage(),56 * nfs_readpages(), or their write equivalents.57 *58 * NB: When adding new byte counters, please include the measured59 * units in the name of each byte counter to help users of this60 * interface determine what exactly is being counted.61 */62enum nfs_stat_bytecounters {63	NFSIOS_NORMALREADBYTES = 0,64	NFSIOS_NORMALWRITTENBYTES,65	NFSIOS_DIRECTREADBYTES,66	NFSIOS_DIRECTWRITTENBYTES,67	NFSIOS_SERVERREADBYTES,68	NFSIOS_SERVERWRITTENBYTES,69	NFSIOS_READPAGES,70	NFSIOS_WRITEPAGES,71	__NFSIOS_BYTESMAX,72};73 74/*75 * NFS event counters76 *77 * These counters provide a low-overhead way of monitoring client78 * activity without enabling NFS trace debugging.  The counters79 * show the rate at which VFS requests are made, and how often the80 * client invalidates its data and attribute caches.  This allows81 * system administrators to monitor such things as how close-to-open82 * is working, and answer questions such as "why are there so many83 * GETATTR requests on the wire?"84 *85 * They also count anamolous events such as short reads and writes,86 * silly renames due to close-after-delete, and operations that87 * change the size of a file (such operations can often be the88 * source of data corruption if applications aren't using file89 * locking properly).90 */91enum nfs_stat_eventcounters {92	NFSIOS_INODEREVALIDATE = 0,93	NFSIOS_DENTRYREVALIDATE,94	NFSIOS_DATAINVALIDATE,95	NFSIOS_ATTRINVALIDATE,96	NFSIOS_VFSOPEN,97	NFSIOS_VFSLOOKUP,98	NFSIOS_VFSACCESS,99	NFSIOS_VFSUPDATEPAGE,100	NFSIOS_VFSREADPAGE,101	NFSIOS_VFSREADPAGES,102	NFSIOS_VFSWRITEPAGE,103	NFSIOS_VFSWRITEPAGES,104	NFSIOS_VFSGETDENTS,105	NFSIOS_VFSSETATTR,106	NFSIOS_VFSFLUSH,107	NFSIOS_VFSFSYNC,108	NFSIOS_VFSLOCK,109	NFSIOS_VFSRELEASE,110	NFSIOS_CONGESTIONWAIT,111	NFSIOS_SETATTRTRUNC,112	NFSIOS_EXTENDWRITE,113	NFSIOS_SILLYRENAME,114	NFSIOS_SHORTREAD,115	NFSIOS_SHORTWRITE,116	NFSIOS_DELAY,117	NFSIOS_PNFS_READ,118	NFSIOS_PNFS_WRITE,119	__NFSIOS_COUNTSMAX,120};121 122#endif	/* _LINUX_NFS_IOSTAT */123