linux 驱动调试添加调试宏方法
来源:互联网 发布:广州有机云计算 编辑:程序博客网 时间:2024/05/29 19:06
linux 驱动调试添加调试宏
1.修改Makefile 添加是否开启debug宏
#Comment / uncomment the following line to disable / enable debugging
DEBUG = y
#Add your debugging flag (or not) to CFLAGS
ifeq ($(DEBUG),y)
DEBFLAGS = -0 -g -DSCULL_DEBUG # "-0" is needed to expand inlines
else
DEBFLAGS = -02
endif
CFLAGS += $(DEBFLAGS)
2.在debug打印函数使用的文件处添加该头文件scull_debug.h
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#undef PDEBUG /* undef it, just in case */
#ifdef SCULL_DEBUG
#ifdef __KERNEL__
/* This on if debugging is on ,and in kernel space */
#define PDEBUG(fmt, args...) printk(KERN_ALERT "[scull]: " fmt, ##args)
#else
/* This one for user space */
#define PDEBUG(fmt, args...) fprintf(stderr, fmt, ##args)
#endif
#else
/* not debugging : nothing */
#define PDEBUG(fmt, args...)
#endif
- linux 驱动调试添加调试宏方法
- linux驱动调试方法
- linux驱动调试方法
- linux驱动--调试方法总结
- Linux下驱动调试方法
- linux 添加huwei3g驱动的调试流程
- 驱动中的调试方法
- 内核驱动调试方法
- linux驱动调试小结
- linux驱动调试相关
- linux驱动调试小结
- linux 内核驱动调试
- Linux设备驱动调试
- linux驱动调试技术
- Linux驱动调试
- linux驱动调试
- linux Camera 驱动调试
- linux驱动调试
- Ubuntu下mysql乱码的解决
- 一个很特别的TCP选项TCP_DEFER_ACCEPT
- VisualSVN Server 安装配置和其客户端的使用
- windows7 快捷键
- Error inflating class
- linux 驱动调试添加调试宏方法
- NetBeans快捷键
- Microsoft SQL Server 2008 install error
- protel99 封装定义
- 统计学 学习笔记 (七)—— 回到现实:得不到数据的整体怎么办?
- MVP这一年
- C/C++ 通用 Makefile
- FrameLayout之我见
- C# Winform 应用程序中,获取某网页的源文件