~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/sunrpc/metrics.h

Version: ~ [ linux-5.11-rc3 ] ~ [ linux-5.10.7 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.89 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.167 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.215 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.251 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.251 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  linux/include/linux/sunrpc/metrics.h
  3  *
  4  *  Declarations for RPC client per-operation metrics
  5  *
  6  *  Copyright (C) 2005  Chuck Lever <cel@netapp.com>
  7  *
  8  *  RPC client per-operation statistics provide latency and retry
  9  *  information about each type of RPC procedure in a given RPC program.
 10  *  These statistics are not for detailed problem diagnosis, but simply
 11  *  to indicate whether the problem is local or remote.
 12  *
 13  *  These counters are not meant to be human-readable, but are meant to be
 14  *  integrated into system monitoring tools such as "sar" and "iostat".  As
 15  *  such, the counters are sampled by the tools over time, and are never
 16  *  zeroed after a file system is mounted.  Moving averages can be computed
 17  *  by the tools by taking the difference between two instantaneous samples
 18  *  and dividing that by the time between the samples.
 19  *
 20  *  The counters are maintained in a single array per RPC client, indexed
 21  *  by procedure number.  There is no need to maintain separate counter
 22  *  arrays per-CPU because these counters are always modified behind locks.
 23  */
 24 
 25 #ifndef _LINUX_SUNRPC_METRICS_H
 26 #define _LINUX_SUNRPC_METRICS_H
 27 
 28 #include <linux/seq_file.h>
 29 #include <linux/ktime.h>
 30 
 31 #define RPC_IOSTATS_VERS        "1.0"
 32 
 33 struct rpc_iostats {
 34         /*
 35          * These counters give an idea about how many request
 36          * transmissions are required, on average, to complete that
 37          * particular procedure.  Some procedures may require more
 38          * than one transmission because the server is unresponsive,
 39          * the client is retransmitting too aggressively, or the
 40          * requests are large and the network is congested.
 41          */
 42         unsigned long           om_ops,         /* count of operations */
 43                                 om_ntrans,      /* count of RPC transmissions */
 44                                 om_timeouts;    /* count of major timeouts */
 45 
 46         /*
 47          * These count how many bytes are sent and received for a
 48          * given RPC procedure type.  This indicates how much load a
 49          * particular procedure is putting on the network.  These
 50          * counts include the RPC and ULP headers, and the request
 51          * payload.
 52          */
 53         unsigned long long      om_bytes_sent,  /* count of bytes out */
 54                                 om_bytes_recv;  /* count of bytes in */
 55 
 56         /*
 57          * The length of time an RPC request waits in queue before
 58          * transmission, the network + server latency of the request,
 59          * and the total time the request spent from init to release
 60          * are measured.
 61          */
 62         ktime_t                 om_queue,       /* queued for xmit */
 63                                 om_rtt,         /* RPC RTT */
 64                                 om_execute;     /* RPC execution */
 65 } ____cacheline_aligned;
 66 
 67 struct rpc_task;
 68 struct rpc_clnt;
 69 
 70 /*
 71  * EXPORTed functions for managing rpc_iostats structures
 72  */
 73 
 74 #ifdef CONFIG_PROC_FS
 75 
 76 struct rpc_iostats *    rpc_alloc_iostats(struct rpc_clnt *);
 77 void                    rpc_count_iostats(const struct rpc_task *,
 78                                           struct rpc_iostats *);
 79 void                    rpc_print_iostats(struct seq_file *, struct rpc_clnt *);
 80 void                    rpc_free_iostats(struct rpc_iostats *);
 81 
 82 #else  /*  CONFIG_PROC_FS  */
 83 
 84 static inline struct rpc_iostats *rpc_alloc_iostats(struct rpc_clnt *clnt) { return NULL; }
 85 static inline void rpc_count_iostats(const struct rpc_task *task,
 86                                      struct rpc_iostats *stats) {}
 87 static inline void rpc_print_iostats(struct seq_file *seq, struct rpc_clnt *clnt) {}
 88 static inline void rpc_free_iostats(struct rpc_iostats *stats) {}
 89 
 90 #endif  /*  CONFIG_PROC_FS  */
 91 
 92 #endif /* _LINUX_SUNRPC_METRICS_H */
 93 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp