打印log是一种常用Debug手段,但是繁多的log会影响系统的性能,为了方便对log的管理,可以采用“log Debug开关”的书写方式。
#define ZZL_DB "zzl:"
#define ZZL_DEBUG
#ifdef ZZL_DEBUG
#define zzl_printk(fmt, arg...) printk(ZZL_DB fmt, ##arg)
#else
#define zzl_printk(fmt, arg...) do {} while (0)
#endif