debug.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. /* #define RPC_PROFILE */
  34. /*
  35. * Debugging macros etc
  36. */
  37. #ifdef RPC_DEBUG
  38. extern unsigned int rpc_debug;
  39. extern unsigned int nfs_debug;
  40. extern unsigned int nfsd_debug;
  41. extern unsigned int nlm_debug;
  42. #endif
  43. #define dprintk(args...) dfprintk(FACILITY, ## args)
  44. #undef ifdebug
  45. #ifdef RPC_DEBUG
  46. # define ifdebug(fac) if (unlikely(rpc_debug & RPCDBG_##fac))
  47. # define dfprintk(fac, args...) do { ifdebug(fac) printk(args); } while(0)
  48. # define RPC_IFDEBUG(x) x
  49. #else
  50. # define ifdebug(fac) if (0)
  51. # define dfprintk(fac, args...) do ; while (0)
  52. # define RPC_IFDEBUG(x)
  53. #endif
  54. /*
  55. * Sysctl interface for RPC debugging
  56. */
  57. #ifdef RPC_DEBUG
  58. void rpc_register_sysctl(void);
  59. void rpc_unregister_sysctl(void);
  60. #endif
  61. #endif /* __KERNEL__ */
  62. /*
  63. * Declarations for the sysctl debug interface, which allows to read or
  64. * change the debug flags for rpc, nfs, nfsd, and lockd. Since the sunrpc
  65. * module currently registers its sysctl table dynamically, the sysctl path
  66. * for module FOO is <CTL_SUNRPC, CTL_FOODEBUG>.
  67. */
  68. enum {
  69. CTL_RPCDEBUG = 1,
  70. CTL_NFSDEBUG,
  71. CTL_NFSDDEBUG,
  72. CTL_NLMDEBUG,
  73. CTL_SLOTTABLE_UDP,
  74. CTL_SLOTTABLE_TCP,
  75. CTL_MIN_RESVPORT,
  76. CTL_MAX_RESVPORT,
  77. };
  78. #endif /* _LINUX_SUNRPC_DEBUG_H_ */