debug.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. #include <linux/config.h>
  11. #include <linux/timer.h>
  12. #include <linux/workqueue.h>
  13. /*
  14. * Enable RPC debugging/profiling.
  15. */
  16. #ifdef CONFIG_SYSCTL
  17. #define RPC_DEBUG
  18. #endif
  19. /* #define RPC_PROFILE */
  20. /*
  21. * RPC debug facilities
  22. */
  23. #define RPCDBG_XPRT 0x0001
  24. #define RPCDBG_CALL 0x0002
  25. #define RPCDBG_DEBUG 0x0004
  26. #define RPCDBG_NFS 0x0008
  27. #define RPCDBG_AUTH 0x0010
  28. #define RPCDBG_PMAP 0x0020
  29. #define RPCDBG_SCHED 0x0040
  30. #define RPCDBG_TRANS 0x0080
  31. #define RPCDBG_SVCSOCK 0x0100
  32. #define RPCDBG_SVCDSP 0x0200
  33. #define RPCDBG_MISC 0x0400
  34. #define RPCDBG_CACHE 0x0800
  35. #define RPCDBG_ALL 0x7fff
  36. #ifdef __KERNEL__
  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...) do { ifdebug(fac) printk(args); } while(0)
  51. # define RPC_IFDEBUG(x) x
  52. #else
  53. # define ifdebug(fac) if (0)
  54. # define dfprintk(fac, args...) do ; while (0)
  55. # define RPC_IFDEBUG(x)
  56. #endif
  57. #ifdef RPC_PROFILE
  58. # define pprintk(args...) printk(## args)
  59. #else
  60. # define pprintk(args...) do ; while (0)
  61. #endif
  62. /*
  63. * Sysctl interface for RPC debugging
  64. */
  65. #ifdef RPC_DEBUG
  66. void rpc_register_sysctl(void);
  67. void rpc_unregister_sysctl(void);
  68. #endif
  69. #endif /* __KERNEL__ */
  70. /*
  71. * Declarations for the sysctl debug interface, which allows to read or
  72. * change the debug flags for rpc, nfs, nfsd, and lockd. Since the sunrpc
  73. * module currently registers its sysctl table dynamically, the sysctl path
  74. * for module FOO is <CTL_SUNRPC, CTL_FOODEBUG>.
  75. */
  76. #define CTL_SUNRPC 7249 /* arbitrary and hopefully unused */
  77. enum {
  78. CTL_RPCDEBUG = 1,
  79. CTL_NFSDEBUG,
  80. CTL_NFSDDEBUG,
  81. CTL_NLMDEBUG,
  82. CTL_SLOTTABLE_UDP,
  83. CTL_SLOTTABLE_TCP,
  84. CTL_MIN_RESVPORT,
  85. CTL_MAX_RESVPORT,
  86. };
  87. #endif /* _LINUX_SUNRPC_DEBUG_H_ */