如何使用dev_dbg 在需要使能log的地方加入下面语句:
参考内核文件include/linux/device.h
在需要打印的C文件中添加下面几行即可
#ifdef dev_dbg(dev, format, arg...)
#undef dev_dbg(dev, format, arg...)#define dev_dbg(dev, format, arg...) printk( KERN_INFO "[<%s>:%d]"format"\n" , __func__, __LINE__, ## arg)
#endif