summaryrefslogtreecommitdiff
path: root/src/pmdas/linux/proc_net_rpc.h
blob: 880dbedc2bb22fe820a425c3d7e224388e225252 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/* 
 * Linux /proc/net/rpc metrics cluster
 *
 * Copyright (c) 2000,2004 Silicon Graphics, Inc.  All Rights Reserved.
 * 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 2 of the License, or (at your
 * option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#define NR_RPC_COUNTERS		18
#define NR_RPC3_COUNTERS	22
#define NR_RPC4_CLI_COUNTERS	35
#define NR_RPC4_SVR_COUNTERS	41

typedef struct {
    struct {
	int		errcode;	/* error from last refresh */
	/* /proc/net/rpc/nfs  "net" */
	unsigned int	netcnt;
	unsigned int	netudpcnt;
	unsigned int	nettcpcnt;
	unsigned int	nettcpconn;

	/* /proc/net/rpc/nfs  "rpc" */
	unsigned int	rpccnt;
	unsigned int	rpcretrans;
	unsigned int	rpcauthrefresh;

	/* /proc/net/rpc/nfs  "proc2" */
	unsigned int reqcounts[NR_RPC_COUNTERS];

	/* /proc/net/rpc/nfs  "proc3" */
	unsigned int reqcounts3[NR_RPC3_COUNTERS];

	/* /proc/net/rpc/nfs  "proc4" */
	unsigned int reqcounts4[NR_RPC4_CLI_COUNTERS];
    } client;

    struct {
	int		errcode;	/* error from last refresh */
	/* /proc/net/rpc/nfsd "rc" and "fh" */
        unsigned int    rchits;         /* repcache hits */
        unsigned int    rcmisses;       /* repcache hits */
        unsigned int    rcnocache;      /* uncached reqs */
        unsigned int    fh_cached;      /* dentry cached */
        unsigned int    fh_valid;       /* dentry validated */
        unsigned int    fh_fixup;       /* dentry fixup validated */
        unsigned int    fh_lookup;      /* new lookup required */
        unsigned int    fh_stale;       /* FH stale error */
        unsigned int    fh_concurrent;  /* concurrent request */
	unsigned int    fh_anon;	/* anon file dentry returned */
	unsigned int	fh_nocache_dir;	/* dir filehandle not found in dcache */
	unsigned int	fh_nocache_nondir; /* nondir filehandle not in dcache */

	/* /proc/net/rpc/nfsd "io" */
	unsigned int	io_read;	/* bytes returned to read requests */
	unsigned int	io_write;	/* bytes passed in write requests */

	/* /proc/net/rpc/nfsd "th" */
	unsigned int	th_cnt;		/* available nfsd threads */
	unsigned int	th_fullcnt;	/* times last free thread used */

	/* /proc/net/rpc/nfsd "net" */
	unsigned int	netcnt;
	unsigned int	netudpcnt;
	unsigned int	nettcpcnt;
	unsigned int	nettcpconn;

	/* /proc/net/rpc/nfsd "rpc" */
	unsigned int	rpccnt;
	unsigned int	rpcerr;
	unsigned int	rpcbadfmt;
	unsigned int	rpcbadauth;
	unsigned int	rpcbadclnt;

	/* /proc/net/rpc/nfsd "proc2" */
	unsigned int reqcounts[NR_RPC_COUNTERS];

	/* /proc/net/rpc/nfsd  "proc3" */
	unsigned int reqcounts3[NR_RPC3_COUNTERS];

	/* /proc/net/rpc/nfsd  "proc4" & "proc4ops" */
	unsigned int reqcounts4[NR_RPC4_SVR_COUNTERS];
    } server;

} proc_net_rpc_t;

extern int refresh_proc_net_rpc(proc_net_rpc_t *);