2 * linux/include/linux/sunrpc/debug.h
4 * Debugging support for sunrpc module
8 #ifndef _LINUX_SUNRPC_DEBUG_H_
9 #define _LINUX_SUNRPC_DEBUG_H_
11 #include <uapi/linux/sunrpc/debug.h>
14 * Debugging macros etc
16 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
17 extern unsigned int rpc_debug;
18 extern unsigned int nfs_debug;
19 extern unsigned int nfsd_debug;
20 extern unsigned int nlm_debug;
23 #define dprintk(fmt, ...) \
24 dfprintk(FACILITY, fmt, ##__VA_ARGS__)
25 #define dprintk_cont(fmt, ...) \
26 dfprintk_cont(FACILITY, fmt, ##__VA_ARGS__)
27 #define dprintk_rcu(fmt, ...) \
28 dfprintk_rcu(FACILITY, fmt, ##__VA_ARGS__)
29 #define dprintk_rcu_cont(fmt, ...) \
30 dfprintk_rcu_cont(FACILITY, fmt, ##__VA_ARGS__)
33 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
34 # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac))
36 # define dfprintk(fac, fmt, ...) \
39 printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \
42 # define dfprintk_cont(fac, fmt, ...) \
45 printk(KERN_CONT fmt, ##__VA_ARGS__); \
48 # define dfprintk_rcu(fac, fmt, ...) \
52 printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \
57 # define dfprintk_rcu_cont(fac, fmt, ...) \
61 printk(KERN_CONT fmt, ##__VA_ARGS__); \
66 # define RPC_IFDEBUG(x) x
68 # define ifdebug(fac) if (0)
69 # define dfprintk(fac, fmt, ...) do {} while (0)
70 # define dfprintk_cont(fac, fmt, ...) do {} while (0)
71 # define dfprintk_rcu(fac, fmt, ...) do {} while (0)
72 # define RPC_IFDEBUG(x)
76 * Sysctl interface for RPC debugging
82 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
83 void rpc_register_sysctl(void);
84 void rpc_unregister_sysctl(void);
85 void sunrpc_debugfs_init(void);
86 void sunrpc_debugfs_exit(void);
87 void rpc_clnt_debugfs_register(struct rpc_clnt *);
88 void rpc_clnt_debugfs_unregister(struct rpc_clnt *);
89 void rpc_xprt_debugfs_register(struct rpc_xprt *);
90 void rpc_xprt_debugfs_unregister(struct rpc_xprt *);
93 sunrpc_debugfs_init(void)
99 sunrpc_debugfs_exit(void)
105 rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
111 rpc_clnt_debugfs_unregister(struct rpc_clnt *clnt)
117 rpc_xprt_debugfs_register(struct rpc_xprt *xprt)
123 rpc_xprt_debugfs_unregister(struct rpc_xprt *xprt)
129 #endif /* _LINUX_SUNRPC_DEBUG_H_ */