ceph_debug.h 929 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _FS_CEPH_DEBUG_H
  2. #define _FS_CEPH_DEBUG_H
  3. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  4. #ifdef CONFIG_CEPH_LIB_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("%.*s %12.12s:%-4d : " fmt, \
  14. 8 - (int)sizeof(KBUILD_MODNAME), " ", \
  15. ceph_file_part(__FILE__, sizeof(__FILE__)), \
  16. __LINE__, ##__VA_ARGS__)
  17. # else
  18. /* faux printk call just to see any compiler warnings. */
  19. # define dout(fmt, ...) do { \
  20. if (0) \
  21. printk(KERN_DEBUG fmt, ##__VA_ARGS__); \
  22. } while (0)
  23. # endif
  24. #else
  25. /*
  26. * or, just wrap pr_debug
  27. */
  28. # define dout(fmt, ...) pr_debug(" " fmt, ##__VA_ARGS__)
  29. #endif
  30. #endif