debug.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * linux/include/linux/lockd/debug.h
  3. *
  4. * Debugging stuff.
  5. *
  6. * Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de>
  7. */
  8. #ifndef LINUX_LOCKD_DEBUG_H
  9. #define LINUX_LOCKD_DEBUG_H
  10. #ifdef __KERNEL__
  11. #include <linux/sunrpc/debug.h>
  12. /*
  13. * Enable lockd debugging.
  14. * Requires RPC_DEBUG.
  15. */
  16. #ifdef RPC_DEBUG
  17. # define LOCKD_DEBUG 1
  18. #endif
  19. #undef ifdebug
  20. #if defined(RPC_DEBUG) && defined(LOCKD_DEBUG)
  21. # define ifdebug(flag) if (unlikely(nlm_debug & NLMDBG_##flag))
  22. #else
  23. # define ifdebug(flag) if (0)
  24. #endif
  25. #endif /* __KERNEL__ */
  26. /*
  27. * Debug flags
  28. */
  29. #define NLMDBG_SVC 0x0001
  30. #define NLMDBG_CLIENT 0x0002
  31. #define NLMDBG_CLNTLOCK 0x0004
  32. #define NLMDBG_SVCLOCK 0x0008
  33. #define NLMDBG_MONITOR 0x0010
  34. #define NLMDBG_CLNTSUBS 0x0020
  35. #define NLMDBG_SVCSUBS 0x0040
  36. #define NLMDBG_HOSTCACHE 0x0080
  37. #define NLMDBG_XDR 0x0100
  38. #define NLMDBG_ALL 0x7fff
  39. /*
  40. * Support for printing NLM cookies in dprintk()
  41. */
  42. #ifdef RPC_DEBUG
  43. struct nlm_cookie;
  44. /* Call this function with the BKL held (it uses a static buffer) */
  45. extern const char *nlmdbg_cookie2a(const struct nlm_cookie *);
  46. #endif
  47. #endif /* LINUX_LOCKD_DEBUG_H */