一种很好的程序调试方法!
1 #undef PDEBUG 2 #ifdef HELLO_DEBUG 3 #define PDEBUG(fmt, args...) printk (KERN_DEBUG "hello: " fmt, ## args) 4 #else 5 #define PDEBUG(fmt, args...) 6 #endif
使用时,如果将#undef PDEBUG改为#define PDEBUG,程序中的打印语句就会打印出来。
本文来自博客园,作者:摩斯电码,未经同意,禁止转载