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

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

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ 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.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * linux/include/linux/sunrpc/debug.h
  4  *
  5  * Debugging support for sunrpc module
  6  *
  7  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  8  */
  9 #ifndef _LINUX_SUNRPC_DEBUG_H_
 10 #define _LINUX_SUNRPC_DEBUG_H_
 11 
 12 #include <uapi/linux/sunrpc/debug.h>
 13 
 14 /*
 15  * Debugging macros etc
 16  */
 17 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
 18 extern unsigned int             rpc_debug;
 19 extern unsigned int             nfs_debug;
 20 extern unsigned int             nfsd_debug;
 21 extern unsigned int             nlm_debug;
 22 #endif
 23 
 24 #define dprintk(fmt, ...)                                               \
 25         dfprintk(FACILITY, fmt, ##__VA_ARGS__)
 26 #define dprintk_cont(fmt, ...)                                          \
 27         dfprintk_cont(FACILITY, fmt, ##__VA_ARGS__)
 28 #define dprintk_rcu(fmt, ...)                                           \
 29         dfprintk_rcu(FACILITY, fmt, ##__VA_ARGS__)
 30 #define dprintk_rcu_cont(fmt, ...)                                      \
 31         dfprintk_rcu_cont(FACILITY, fmt, ##__VA_ARGS__)
 32 
 33 #undef ifdebug
 34 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
 35 # define ifdebug(fac)           if (unlikely(rpc_debug & RPCDBG_##fac))
 36 
 37 # define dfprintk(fac, fmt, ...)                                        \
 38 do {                                                                    \
 39         ifdebug(fac)                                                    \
 40                 printk(KERN_DEFAULT fmt, ##__VA_ARGS__);                \
 41 } while (0)
 42 
 43 # define dfprintk_cont(fac, fmt, ...)                                   \
 44 do {                                                                    \
 45         ifdebug(fac)                                                    \
 46                 printk(KERN_CONT fmt, ##__VA_ARGS__);                   \
 47 } while (0)
 48 
 49 # define dfprintk_rcu(fac, fmt, ...)                                    \
 50 do {                                                                    \
 51         ifdebug(fac) {                                                  \
 52                 rcu_read_lock();                                        \
 53                 printk(KERN_DEFAULT fmt, ##__VA_ARGS__);                \
 54                 rcu_read_unlock();                                      \
 55         }                                                               \
 56 } while (0)
 57 
 58 # define dfprintk_rcu_cont(fac, fmt, ...)                               \
 59 do {                                                                    \
 60         ifdebug(fac) {                                                  \
 61                 rcu_read_lock();                                        \
 62                 printk(KERN_CONT fmt, ##__VA_ARGS__);                   \
 63                 rcu_read_unlock();                                      \
 64         }                                                               \
 65 } while (0)
 66 
 67 # define RPC_IFDEBUG(x)         x
 68 #else
 69 # define ifdebug(fac)           if (0)
 70 # define dfprintk(fac, fmt, ...)        do {} while (0)
 71 # define dfprintk_cont(fac, fmt, ...)   do {} while (0)
 72 # define dfprintk_rcu(fac, fmt, ...)    do {} while (0)
 73 # define RPC_IFDEBUG(x)
 74 #endif
 75 
 76 /*
 77  * Sysctl interface for RPC debugging
 78  */
 79 
 80 struct rpc_clnt;
 81 struct rpc_xprt;
 82 
 83 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
 84 void            rpc_register_sysctl(void);
 85 void            rpc_unregister_sysctl(void);
 86 void            sunrpc_debugfs_init(void);
 87 void            sunrpc_debugfs_exit(void);
 88 void            rpc_clnt_debugfs_register(struct rpc_clnt *);
 89 void            rpc_clnt_debugfs_unregister(struct rpc_clnt *);
 90 void            rpc_xprt_debugfs_register(struct rpc_xprt *);
 91 void            rpc_xprt_debugfs_unregister(struct rpc_xprt *);
 92 #else
 93 static inline void
 94 sunrpc_debugfs_init(void)
 95 {
 96         return;
 97 }
 98 
 99 static inline void
100 sunrpc_debugfs_exit(void)
101 {
102         return;
103 }
104 
105 static inline void
106 rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
107 {
108         return;
109 }
110 
111 static inline void
112 rpc_clnt_debugfs_unregister(struct rpc_clnt *clnt)
113 {
114         return;
115 }
116 
117 static inline void
118 rpc_xprt_debugfs_register(struct rpc_xprt *xprt)
119 {
120         return;
121 }
122 
123 static inline void
124 rpc_xprt_debugfs_unregister(struct rpc_xprt *xprt)
125 {
126         return;
127 }
128 #endif
129 
130 #endif /* _LINUX_SUNRPC_DEBUG_H_ */
131 

~ [ 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