在KERNEL中加入DEBUG

#if 0
#undef PDEBUG
#ifdef SCULL_DEBUG

#  ifdef _ _KERNEL_ _
   /* This one if debugging is on, and kernel space */
#    define PDEBUG(fmt, args...) printk( KERN_DEBUG "in machine: " fmt, ## args)
#  else
   /* This one for user space */
#    define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)
#  endif

#else
#  define PDEBUG(fmt, args...) /* not debugging: nothing */
#endif


#undef PDEBUGG
#define PDEBUGG(fmt, args...) /* nothing: it's a placeholder */ MODULE_LICENSE("GPL");
#endif
#define DEBUG_OUTPUT "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
//#define PDEBUG
#ifdef  PDEBUG
    #define PLOG(fmt,args...) printk("scull: " DEBUG_OUTPUT fmt DEBUG_OUTPUT "\n",##args)
#else
    #define PLOG(fmt,args...) /*do nothing */
#endif

 

  PLOG("in machine imx-3stack-tef663x 555555555:%s",__FUNCTION__);

你可能感兴趣的:(在KERNEL中加入DEBUG)