ceph_debug.h 877 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef _FS_CEPH_DEBUG_H
  2. #define _FS_CEPH_DEBUG_H
  3. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  4. #ifdef CONFIG_CEPH_FS_PRETTYDEBUG
  5. /*
  6. * wrap pr_debug to include a filename:lineno prefix on each line.
  7. * this incurs some overhead (kernel size and execution time) due to
  8. * the extra function call at each call site.
  9. */
  10. # if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
  11. extern const char *ceph_file_part(const char *s, int len);
  12. # define dout(fmt, ...) \
  13. pr_debug(" %12.12s:%-4d : " fmt, \
  14. ceph_file_part(__FILE__, sizeof(__FILE__)), \
  15. __LINE__, ##__VA_ARGS__)
  16. # else
  17. /* faux printk call just to see any compiler warnings. */
  18. # define dout(fmt, ...) do { \
  19. if (0) \
  20. printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
  21. } while (0)
  22. # endif
  23. #else
  24. /*
  25. * or, just wrap pr_debug
  26. */
  27. # define dout(fmt, ...) pr_debug(" " fmt, ##__VA_ARGS__)
  28. #endif
  29. #endif