debug.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. * RPC debug facilities
  12. */
  13. #define RPCDBG_XPRT 0x0001
  14. #define RPCDBG_CALL 0x0002
  15. #define RPCDBG_DEBUG 0x0004
  16. #define RPCDBG_NFS 0x0008
  17. #define RPCDBG_AUTH 0x0010
  18. #define RPCDBG_BIND 0x0020
  19. #define RPCDBG_SCHED 0x0040
  20. #define RPCDBG_TRANS 0x0080
  21. #define RPCDBG_SVCXPRT 0x0100
  22. #define RPCDBG_SVCDSP 0x0200
  23. #define RPCDBG_MISC 0x0400
  24. #define RPCDBG_CACHE 0x0800
  25. #define RPCDBG_ALL 0x7fff
  26. #ifdef __KERNEL__
  27. /*
  28. * Enable RPC debugging/profiling.
  29. */
  30. #ifdef CONFIG_SYSCTL
  31. #define RPC_DEBUG
  32. #endif
  33. #ifdef CONFIG_TRACEPOINTS
  34. #define RPC_TRACEPOINTS
  35. #endif
  36. /* #define RPC_PROFILE */
  37. /*
  38. * Debugging macros etc
  39. */
  40. #ifdef RPC_DEBUG
  41. extern unsigned int rpc_debug;
  42. extern unsigned int nfs_debug;
  43. extern unsigned int nfsd_debug;
  44. extern unsigned int nlm_debug;
  45. #endif
  46. #define dprintk(args...) dfprintk(FACILITY, ## args)
  47. #undef ifdebug
  48. #ifdef RPC_DEBUG
  49. # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac))
  50. # define dfprintk(fac, args...) \
  51. do { \
  52. ifdebug(fac) \
  53. printk(KERN_DEFAULT args); \
  54. } while (0)
  55. # define RPC_IFDEBUG(x) x
  56. #else
  57. # define ifdebug(fac) if (0)
  58. # define dfprintk(fac, args...) do ; while (0)
  59. # define RPC_IFDEBUG(x)
  60. #endif
  61. /*
  62. * Sysctl interface for RPC debugging
  63. */
  64. #ifdef RPC_DEBUG
  65. void rpc_register_sysctl(void);
  66. void rpc_unregister_sysctl(void);
  67. #endif
  68. #endif /* __KERNEL__ */
  69. /*
  70. * Declarations for the sysctl debug interface, which allows to read or
  71. * change the debug flags for rpc, nfs, nfsd, and lockd. Since the sunrpc
  72. * module currently registers its sysctl table dynamically, the sysctl path
  73. * for module FOO is <CTL_SUNRPC, CTL_FOODEBUG>.
  74. */
  75. enum {
  76. CTL_RPCDEBUG = 1,
  77. CTL_NFSDEBUG,
  78. CTL_NFSDDEBUG,
  79. CTL_NLMDEBUG,
  80. CTL_SLOTTABLE_UDP,
  81. CTL_SLOTTABLE_TCP,
  82. CTL_MIN_RESVPORT,
  83. CTL_MAX_RESVPORT,
  84. };
  85. #endif /* _LINUX_SUNRPC_DEBUG_H_ */