blob: edc64219f92b1153b5f0c2517d06fa46d1228ea8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * linux/include/linux/sunrpc/stats.h
3 *
4 * Client statistics collection for SUN RPC
5 *
6 * Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef _LINUX_SUNRPC_STATS_H
10#define _LINUX_SUNRPC_STATS_H
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012#include <linux/proc_fs.h>
13
14struct rpc_stat {
Trond Myklebusta613fa12012-01-20 13:53:56 -050015 const struct rpc_program *program;
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
17 unsigned int netcnt,
18 netudpcnt,
19 nettcpcnt,
20 nettcpconn,
21 netreconn;
22 unsigned int rpccnt,
23 rpcretrans,
24 rpcauthrefresh,
25 rpcgarbage;
26};
27
28struct svc_stat {
29 struct svc_program * program;
30
31 unsigned int netcnt,
32 netudpcnt,
33 nettcpcnt,
34 nettcpconn;
35 unsigned int rpccnt,
36 rpcbadfmt,
37 rpcbadauth,
38 rpcbadclnt;
39};
40
Pavel Emelyanov4f42d0d2010-09-27 14:01:58 +040041struct net;
42#ifdef CONFIG_PROC_FS
43int rpc_proc_init(struct net *);
44void rpc_proc_exit(struct net *);
45#else
46static inline int rpc_proc_init(struct net *net)
47{
48 return 0;
49}
50
51static inline void rpc_proc_exit(struct net *net)
52{
53}
54#endif
55
Linus Torvalds1da177e2005-04-16 15:20:36 -070056#ifdef MODULE
57void rpc_modcount(struct inode *, int);
58#endif
59
60#ifdef CONFIG_PROC_FS
Stanislav Kinsburskyec7652a2011-12-06 16:42:40 +030061struct proc_dir_entry * rpc_proc_register(struct net *,struct rpc_stat *);
62void rpc_proc_unregister(struct net *,const char *);
Trond Myklebusta613fa12012-01-20 13:53:56 -050063void rpc_proc_zero(const struct rpc_program *);
Stanislav Kinsbursky246590f2011-12-06 16:42:49 +030064struct proc_dir_entry * svc_proc_register(struct net *, struct svc_stat *,
Arjan van de Ven99ac48f2006-03-28 01:56:41 -080065 const struct file_operations *);
Stanislav Kinsbursky246590f2011-12-06 16:42:49 +030066void svc_proc_unregister(struct net *, const char *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
68void svc_seq_show(struct seq_file *,
69 const struct svc_stat *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070070#else
71
Randy Dunlapcc9f4be2012-01-24 03:28:07 +000072static inline struct proc_dir_entry *rpc_proc_register(struct net *net, struct rpc_stat *s) { return NULL; }
73static inline void rpc_proc_unregister(struct net *net, const char *p) {}
Trond Myklebusta613fa12012-01-20 13:53:56 -050074static inline void rpc_proc_zero(const struct rpc_program *p) {}
Linus Torvalds1da177e2005-04-16 15:20:36 -070075
Stanislav Kinsbursky246590f2011-12-06 16:42:49 +030076static inline struct proc_dir_entry *svc_proc_register(struct net *net, struct svc_stat *s,
Arjan van de Ven99ac48f2006-03-28 01:56:41 -080077 const struct file_operations *f) { return NULL; }
Stanislav Kinsbursky246590f2011-12-06 16:42:49 +030078static inline void svc_proc_unregister(struct net *net, const char *p) {}
Linus Torvalds1da177e2005-04-16 15:20:36 -070079
80static inline void svc_seq_show(struct seq_file *seq,
81 const struct svc_stat *st) {}
Linus Torvalds1da177e2005-04-16 15:20:36 -070082#endif
83
84#endif /* _LINUX_SUNRPC_STATS_H */