比如要打开某个驱动中的dev_dbg,那么需要在驱动文件.c中这些行"<linux/device.h>"或者"<linux /platfom_device.h>"(device.h包含platform_device.h)之前定义DEBUG

如:drivers/mtd/spi-nor/spi-nor.c

第一步:

#include <linux/module.h>
 #define DEBUG 1   新增的内容,最好是将此宏定义添加在所有头文件前面,以防漏掉DEBUG的定义
#include <linux/device.h>
 #include <linux/mutex.h>

第二步(这一步笔者认为可选):

在make menuconfig配置CONFIG_CONSOLE_LOGLEVEL_DEFAULT这个选项的值为8

Location:

  -> Kernel hacking

    -> printk and dmesg options 

注意内核版本为4.14

相关文章:

  • 2021-05-21
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2018-09-27
  • 2021-05-19
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-12-05
  • 2021-10-17
  • 2022-12-23
相关资源
相似解决方案