cifs_debug.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. *
  3. * Copyright (c) International Business Machines Corp., 2000,2002
  4. * Modified by Steve French (sfrench@us.ibm.com)
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
  14. * the GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. */
  21. #ifndef _H_CIFS_DEBUG
  22. #define _H_CIFS_DEBUG
  23. void cifs_dump_mem(char *label, void *data, int length);
  24. void cifs_dump_detail(void *);
  25. void cifs_dump_mids(struct TCP_Server_Info *);
  26. #ifdef CONFIG_CIFS_DEBUG2
  27. #define DBG2 2
  28. #else
  29. #define DBG2 0
  30. #endif
  31. extern int traceSMB; /* flag which enables the function below */
  32. void dump_smb(void *, int);
  33. #define CIFS_INFO 0x01
  34. #define CIFS_RC 0x02
  35. #define CIFS_TIMER 0x04
  36. extern int cifsFYI;
  37. extern int cifsERROR;
  38. /*
  39. * debug ON
  40. * --------
  41. */
  42. #ifdef CONFIG_CIFS_DEBUG
  43. /* information message: e.g., configuration, major event */
  44. #define cifsfyi(fmt, ...) \
  45. do { \
  46. if (cifsFYI & CIFS_INFO) \
  47. printk(KERN_DEBUG "%s: " fmt "\n", \
  48. __FILE__, ##__VA_ARGS__); \
  49. } while (0)
  50. #define cFYI(set, fmt, ...) \
  51. do { \
  52. if (set) \
  53. cifsfyi(fmt, ##__VA_ARGS__); \
  54. } while (0)
  55. #define cifswarn(fmt, ...) \
  56. printk(KERN_WARNING fmt "\n", ##__VA_ARGS__)
  57. /* error event message: e.g., i/o error */
  58. #define cifserror(fmt, ...) \
  59. do { \
  60. if (cifsERROR) \
  61. printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
  62. } while (0)
  63. #define cERROR(set, fmt, ...) \
  64. do { \
  65. if (set) \
  66. cifserror(fmt, ##__VA_ARGS__); \
  67. } while (0)
  68. /*
  69. * debug OFF
  70. * ---------
  71. */
  72. #else /* _CIFS_DEBUG */
  73. #define cifsfyi(fmt, ...) \
  74. do { \
  75. if (0) \
  76. printk(KERN_DEBUG "%s: " fmt "\n", \
  77. __FILE__, ##__VA_ARGS__); \
  78. } while (0)
  79. #define cFYI(set, fmt, ...) \
  80. do { \
  81. if (0 && set) \
  82. cifsfyi(fmt, ##__VA_ARGS__); \
  83. } while (0)
  84. #define cifserror(fmt, ...) \
  85. do { \
  86. if (0) \
  87. printk(KERN_ERR "CIFS VFS: " fmt "\n", ##__VA_ARGS__); \
  88. } while (0)
  89. #define cERROR(set, fmt, ...) \
  90. do { \
  91. if (0 && set) \
  92. cifserror(fmt, ##__VA_ARGS__); \
  93. } while (0)
  94. #endif /* _CIFS_DEBUG */
  95. #endif /* _H_CIFS_DEBUG */