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

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

Version: ~ [ linux-5.15-rc5 ] ~ [ linux-5.14.11 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.72 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.152 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.210 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.250 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.286 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.288 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * linux/include/linux/sunrpc/debug.h
  3  *
  4  * Debugging support for sunrpc module
  5  *
  6  * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
  7  */
  8 #ifndef _LINUX_SUNRPC_DEBUG_H_
  9 #define _LINUX_SUNRPC_DEBUG_H_
 10 
 11 #include <uapi/linux/sunrpc/debug.h>
 12 
 13 /*
 14  * Debugging macros etc
 15  */
 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;
 21 #endif
 22 
 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__)
 31 
 32 #undef ifdebug
 33 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
 34 # define ifdebug(fac)           if (unlikely(rpc_debug & RPCDBG_##fac))
 35 
 36 # define dfprintk(fac, fmt, ...)                                        \
 37 do {                                                                    \
 38         ifdebug(fac)                                                    \
 39                 printk(KERN_DEFAULT fmt, ##__VA_ARGS__);                \
 40 } while (0)
 41 
 42 # define dfprintk_cont(fac, fmt, ...)                                   \
 43 do {                                                                    \
 44         ifdebug(fac)                                                    \
 45                 printk(KERN_CONT fmt, ##__VA_ARGS__);                   \
 46 } while (0)
 47 
 48 # define dfprintk_rcu(fac, fmt, ...)                                    \
 49 do {                                                                    \
 50         ifdebug(fac) {                                                  \
 51                 rcu_read_lock();                                        \
 52                 printk(KERN_DEFAULT fmt, ##__VA_ARGS__);                \
 53                 rcu_read_unlock();                                      \
 54         }                                                               \
 55 } while (0)
 56 
 57 # define dfprintk_rcu_cont(fac, fmt, ...)                               \
 58 do {                                                                    \
 59         ifdebug(fac) {                                                  \
 60                 rcu_read_lock();                                        \
 61                 printk(KERN_CONT fmt, ##__VA_ARGS__);                   \
 62                 rcu_read_unlock();                                      \
 63         }                                                               \
 64 } while (0)
 65 
 66 # define RPC_IFDEBUG(x)         x
 67 #else
 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)
 73 #endif
 74 
 75 /*
 76  * Sysctl interface for RPC debugging
 77  */
 78 
 79 struct rpc_clnt;
 80 struct rpc_xprt;
 81 
 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 *);
 91 #else
 92 static inline void
 93 sunrpc_debugfs_init(void)
 94 {
 95         return;
 96 }
 97 
 98 static inline void
 99 sunrpc_debugfs_exit(void)
100 {
101         return;
102 }
103 
104 static inline void
105 rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
106 {
107         return;
108 }
109 
110 static inline void
111 rpc_clnt_debugfs_unregister(struct rpc_clnt *clnt)
112 {
113         return;
114 }
115 
116 static inline void
117 rpc_xprt_debugfs_register(struct rpc_xprt *xprt)
118 {
119         return;
120 }
121 
122 static inline void
123 rpc_xprt_debugfs_unregister(struct rpc_xprt *xprt)
124 {
125         return;
126 }
127 #endif
128 
129 #endif /* _LINUX_SUNRPC_DEBUG_H_ */
130 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp