diff options
Diffstat (limited to 'include/linux/sunrpc/debug.h')
| -rw-r--r-- | include/linux/sunrpc/debug.h | 64 |
1 files changed, 49 insertions, 15 deletions
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h index 9385bd74c860..c57d8ea0716c 100644 --- a/include/linux/sunrpc/debug.h +++ b/include/linux/sunrpc/debug.h | |||
| @@ -10,22 +10,10 @@ | |||
| 10 | 10 | ||
| 11 | #include <uapi/linux/sunrpc/debug.h> | 11 | #include <uapi/linux/sunrpc/debug.h> |
| 12 | 12 | ||
| 13 | |||
| 14 | /* | ||
| 15 | * Enable RPC debugging/profiling. | ||
| 16 | */ | ||
| 17 | #ifdef CONFIG_SUNRPC_DEBUG | ||
| 18 | #define RPC_DEBUG | ||
| 19 | #endif | ||
| 20 | #ifdef CONFIG_TRACEPOINTS | ||
| 21 | #define RPC_TRACEPOINTS | ||
| 22 | #endif | ||
| 23 | /* #define RPC_PROFILE */ | ||
| 24 | |||
| 25 | /* | 13 | /* |
| 26 | * Debugging macros etc | 14 | * Debugging macros etc |
| 27 | */ | 15 | */ |
| 28 | #ifdef RPC_DEBUG | 16 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
| 29 | extern unsigned int rpc_debug; | 17 | extern unsigned int rpc_debug; |
| 30 | extern unsigned int nfs_debug; | 18 | extern unsigned int nfs_debug; |
| 31 | extern unsigned int nfsd_debug; | 19 | extern unsigned int nfsd_debug; |
| @@ -36,7 +24,7 @@ extern unsigned int nlm_debug; | |||
| 36 | #define dprintk_rcu(args...) dfprintk_rcu(FACILITY, ## args) | 24 | #define dprintk_rcu(args...) dfprintk_rcu(FACILITY, ## args) |
| 37 | 25 | ||
| 38 | #undef ifdebug | 26 | #undef ifdebug |
| 39 | #ifdef RPC_DEBUG | 27 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) |
| 40 | # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac)) | 28 | # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac)) |
| 41 | 29 | ||
| 42 | # define dfprintk(fac, args...) \ | 30 | # define dfprintk(fac, args...) \ |
| @@ -65,9 +53,55 @@ extern unsigned int nlm_debug; | |||
| 65 | /* | 53 | /* |
| 66 | * Sysctl interface for RPC debugging | 54 | * Sysctl interface for RPC debugging |
| 67 | */ | 55 | */ |
| 68 | #ifdef RPC_DEBUG | 56 | |
| 57 | struct rpc_clnt; | ||
| 58 | struct rpc_xprt; | ||
| 59 | |||
| 60 | #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) | ||
| 69 | void rpc_register_sysctl(void); | 61 | void rpc_register_sysctl(void); |
| 70 | void rpc_unregister_sysctl(void); | 62 | void rpc_unregister_sysctl(void); |
| 63 | int sunrpc_debugfs_init(void); | ||
| 64 | void sunrpc_debugfs_exit(void); | ||
| 65 | int rpc_clnt_debugfs_register(struct rpc_clnt *); | ||
| 66 | void rpc_clnt_debugfs_unregister(struct rpc_clnt *); | ||
| 67 | int rpc_xprt_debugfs_register(struct rpc_xprt *); | ||
| 68 | void rpc_xprt_debugfs_unregister(struct rpc_xprt *); | ||
| 69 | #else | ||
| 70 | static inline int | ||
| 71 | sunrpc_debugfs_init(void) | ||
| 72 | { | ||
| 73 | return 0; | ||
| 74 | } | ||
| 75 | |||
| 76 | static inline void | ||
| 77 | sunrpc_debugfs_exit(void) | ||
| 78 | { | ||
| 79 | return; | ||
| 80 | } | ||
| 81 | |||
| 82 | static inline int | ||
| 83 | rpc_clnt_debugfs_register(struct rpc_clnt *clnt) | ||
| 84 | { | ||
| 85 | return 0; | ||
| 86 | } | ||
| 87 | |||
| 88 | static inline void | ||
| 89 | rpc_clnt_debugfs_unregister(struct rpc_clnt *clnt) | ||
| 90 | { | ||
| 91 | return; | ||
| 92 | } | ||
| 93 | |||
| 94 | static inline int | ||
| 95 | rpc_xprt_debugfs_register(struct rpc_xprt *xprt) | ||
| 96 | { | ||
| 97 | return 0; | ||
| 98 | } | ||
| 99 | |||
| 100 | static inline void | ||
| 101 | rpc_xprt_debugfs_unregister(struct rpc_xprt *xprt) | ||
| 102 | { | ||
| 103 | return; | ||
| 104 | } | ||
| 71 | #endif | 105 | #endif |
| 72 | 106 | ||
| 73 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ | 107 | #endif /* _LINUX_SUNRPC_DEBUG_H_ */ |
