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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

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

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php