debug.h 504 B

12345678910111213141516171819
  1. /*Comment/uncomment the following line to disable/enable debugging,
  2. OR define(or NOT) it in Makefile.
  3. */
  4. //#define NDEBUG
  5. #undef pr_debug /* undef it, just in case */
  6. #ifndef NDEBUG
  7. #ifdef __KERNEL__
  8. /* This one if debugging is on, and kernel space */
  9. #define pr_debug(fmt, args...) printk( KERN_ERR fmt, ## args)
  10. #else
  11. /* This one for user space */
  12. #define pr_debug(fmt, args...) fprintf(stderr, fmt, ## args)
  13. #endif
  14. #else
  15. #define pr_debug(fmt, args...) /* not debugging: nothing */
  16. #endif