2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* linux/include/linux/sunrpc/debug.h
|
|
|
|
*
|
|
|
|
* Debugging support for sunrpc module
|
|
|
|
*
|
|
|
|
* Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
|
|
|
|
*/
|
|
|
|
#ifndef _LINUX_SUNRPC_DEBUG_H_
|
|
|
|
#define _LINUX_SUNRPC_DEBUG_H_
|
|
|
|
|
2012-10-09 16:49:04 +08:00
|
|
|
#include <uapi/linux/sunrpc/debug.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-04-25 22:16:44 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Enable RPC debugging/profiling.
|
|
|
|
*/
|
2012-03-19 02:07:42 +08:00
|
|
|
#ifdef CONFIG_SUNRPC_DEBUG
|
2006-04-25 22:16:44 +08:00
|
|
|
#define RPC_DEBUG
|
|
|
|
#endif
|
2012-02-09 11:01:15 +08:00
|
|
|
#ifdef CONFIG_TRACEPOINTS
|
|
|
|
#define RPC_TRACEPOINTS
|
|
|
|
#endif
|
2006-04-25 22:16:44 +08:00
|
|
|
/* #define RPC_PROFILE */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Debugging macros etc
|
|
|
|
*/
|
|
|
|
#ifdef RPC_DEBUG
|
|
|
|
extern unsigned int rpc_debug;
|
|
|
|
extern unsigned int nfs_debug;
|
|
|
|
extern unsigned int nfsd_debug;
|
|
|
|
extern unsigned int nlm_debug;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define dprintk(args...) dfprintk(FACILITY, ## args)
|
2012-03-02 06:00:56 +08:00
|
|
|
#define dprintk_rcu(args...) dfprintk_rcu(FACILITY, ## args)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#undef ifdebug
|
|
|
|
#ifdef RPC_DEBUG
|
|
|
|
# define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac))
|
2012-03-02 06:00:56 +08:00
|
|
|
|
2012-02-16 05:35:08 +08:00
|
|
|
# define dfprintk(fac, args...) \
|
|
|
|
do { \
|
|
|
|
ifdebug(fac) \
|
|
|
|
printk(KERN_DEFAULT args); \
|
|
|
|
} while (0)
|
2012-03-02 06:00:56 +08:00
|
|
|
|
|
|
|
# define dfprintk_rcu(fac, args...) \
|
|
|
|
do { \
|
|
|
|
ifdebug(fac) { \
|
|
|
|
rcu_read_lock(); \
|
|
|
|
printk(KERN_DEFAULT args); \
|
|
|
|
rcu_read_unlock(); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
# define RPC_IFDEBUG(x) x
|
|
|
|
#else
|
|
|
|
# define ifdebug(fac) if (0)
|
2012-03-21 07:20:53 +08:00
|
|
|
# define dfprintk(fac, args...) do {} while (0)
|
|
|
|
# define dfprintk_rcu(fac, args...) do {} while (0)
|
2005-04-17 06:20:36 +08:00
|
|
|
# define RPC_IFDEBUG(x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Sysctl interface for RPC debugging
|
|
|
|
*/
|
|
|
|
#ifdef RPC_DEBUG
|
|
|
|
void rpc_register_sysctl(void);
|
|
|
|
void rpc_unregister_sysctl(void);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _LINUX_SUNRPC_DEBUG_H_ */
|