打开ev_dbg的log信息
来源:互联网 发布:免费报税软件 编辑:程序博客网 时间:2024/06/04 19:41
需要两个步骤:
1 打开调试开关:
你调试的文件中必然包含了<linux/device.h>,或者《linux /paltforam_device.h》,后者包含了前者,在包含此头文件之前,使用#define DEBUG 1 来打开调试开关:例如
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/clk.h>
#include <linux/module.h>
#define DEBUG 1
#include <linux/platform_device.h>
在linux/device.h文件中:
#define dev_printk(level, dev, format, arg...) \
printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
#ifdef DEBUG
#define dev_dbg(dev, format, arg...) \
dev_printk(KERN_DEBUG , dev , format , ## arg)
#else
static inline int __attribute__ ((format (printf, 2, 3)))
dev_dbg(struct device * dev, const char * fmt, ...)
{
return 0;
}
#endif
2 修改文件kernel/printk文件
/* printk's without a loglevel use this.. */
#define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */
/* We show everything that is MORE important than this.. */
#define MINIMUM_CONSOLE_LOGLEVEL 1 /* Minimum loglevel we let people use */
#define DEFAULT_CONSOLE_LOGLEVEL 8 /* anything MORE serious than KERN_DEBUG */
其中DEFAULT_CONSOLE_LOGLEVEL 为终端console输出的最低级别,比这严重的都将输出。原来该值为7,则调试信息无法输出,修改为8则全部有输出。
linux/kernel文件中
#define KERN_EMERG "<0>" /* system is unusable */
#define KERN_ALERT "<1>" /* action must be taken immediately */
#define KERN_CRIT "<2>" /* critical conditions */
#define KERN_ERR "<3>" /* error conditions */
#define KERN_WARNING "<4>" /* warning conditions */
#define KERN_NOTICE "<5>" /* normal but significant condition */
#define KERN_INFO "<6>" /* informational */
#define KERN_DEBUG "<7>" /* debug-level messages */
可以看到KERN_DEBUG是级别最低的。
- 打开ev_dbg的log信息
- 如何打开osip/eXosip库的trace log 调试信息
- 彩色的log信息
- 华为手机的Log打开
- 打开LK log的方法
- 控制Log信息的函数
- 修改svn的log信息
- Log的五种信息
- eclipse的log信息一闪而过
- log 信息
- log信息
- Log信息
- 【tips】如何打开Ibatis的log
- user版本打开kernel的log
- Android 直接打开log的一种方法
- 完全打开lk log的方法
- Python log 的正确打开方式
- 打开Linux内核启动早期的log
- ADO编程的网址---->vc++利用ADO操作数据库的网址
- USC 20121007 组队赛 H题 矩阵乘法
- µC/OS-II内存管理
- 内存管理函数HeapAlloc,LocalAlloc,VirtualAlloc,malloc,new的异同
- GBK编码表
- 打开ev_dbg的log信息
- Android自动化工具Monkeyrunner使用(六) —— touch
- MyEclipse10离线安装SVN插件
- SpringMVC+FreeMarker(FTL)Integration example
- 销售订单隐藏成本价格出口 user-exit
- 未来在哪里
- 一枕落花香
- Python 代码性能优化技巧
- org.hibernate.hql.ast.QuerySyntaxException: is not mapped 异常总结 .