aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sunrpc/debug.h')
-rw-r--r--include/linux/sunrpc/debug.h58
1 files changed, 40 insertions, 18 deletions
diff --git a/include/linux/sunrpc/debug.h b/include/linux/sunrpc/debug.h
index 59a7889e15db..8da0f37f3bdc 100644
--- a/include/linux/sunrpc/debug.h
+++ b/include/linux/sunrpc/debug.h
@@ -20,33 +20,55 @@ extern unsigned int nfsd_debug;
20extern unsigned int nlm_debug; 20extern unsigned int nlm_debug;
21#endif 21#endif
22 22
23#define dprintk(args...) dfprintk(FACILITY, ## args) 23#define dprintk(fmt, ...) \
24#define dprintk_rcu(args...) dfprintk_rcu(FACILITY, ## args) 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__)
25 31
26#undef ifdebug 32#undef ifdebug
27#if IS_ENABLED(CONFIG_SUNRPC_DEBUG) 33#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
28# define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac)) 34# define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac))
29 35
30# define dfprintk(fac, args...) \ 36# define dfprintk(fac, fmt, ...) \
31 do { \ 37do { \
32 ifdebug(fac) \ 38 ifdebug(fac) \
33 printk(KERN_DEFAULT args); \ 39 printk(KERN_DEFAULT fmt, ##__VA_ARGS__); \
34 } while (0) 40} while (0)
35 41
36# define dfprintk_rcu(fac, args...) \ 42# define dfprintk_cont(fac, fmt, ...) \
37 do { \ 43do { \
38 ifdebug(fac) { \ 44 ifdebug(fac) \
39 rcu_read_lock(); \ 45 printk(KERN_CONT fmt, ##__VA_ARGS__); \
40 printk(KERN_DEFAULT args); \ 46} while (0)
41 rcu_read_unlock(); \ 47
42 } \ 48# define dfprintk_rcu(fac, fmt, ...) \
43 } while (0) 49do { \
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, ...) \
58do { \
59 ifdebug(fac) { \
60 rcu_read_lock(); \
61 printk(KERN_CONT fmt, ##__VA_ARGS__); \
62 rcu_read_unlock(); \
63 } \
64} while (0)
44 65
45# define RPC_IFDEBUG(x) x 66# define RPC_IFDEBUG(x) x
46#else 67#else
47# define ifdebug(fac) if (0) 68# define ifdebug(fac) if (0)
48# define dfprintk(fac, args...) do {} while (0) 69# define dfprintk(fac, fmt, ...) do {} while (0)
49# define dfprintk_rcu(fac, args...) do {} while (0) 70# define dfprintk_cont(fac, fmt, ...) do {} while (0)
71# define dfprintk_rcu(fac, fmt, ...) do {} while (0)
50# define RPC_IFDEBUG(x) 72# define RPC_IFDEBUG(x)
51#endif 73#endif
52 74