- 论坛徽章:
- 0
|
还有一个问题!!
我找到以下两个函数:usb_skel_init和usb_skel_exit(大约在文件的尾部吧),并分别在其中增加一条打印指令:
printk(KERN_ALERT "Entering myusb init\n"); // 加入usb_skel_init函数中
printk(KERN_ALERT "Entering myusb exit\n"); // 加入usb_skel_exit函数中
用来调试的,测试系统是否调用过这个函数。
KERN_ALERT是再linux/kernel.h里面定义的。
我查看了一下我的kernel.h ,如下:
[root@localhost usr]# cat /usr/include/linux/kernel.h
#ifndef _LINUX_KERNEL_H
#define _LINUX_KERNEL_H
/*
* 'kernel.h' contains some often-used function prototypes etc
*/
#define SI_LOAD_SHIFT 16
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* swap space still available */
unsigned short procs; /* Number of current processes */
unsigned short pad; /* explicit padding for m68k */
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
};
/* Force a compilation error if condition is true */
#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
/* Force a compilation error if condition is true, but also produce a
result (of value 0 and type size_t), so the expression can be used
e.g. in a structure initializer (or where-ever else comma expressions
aren't permitted). */
#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1)
/* Trap pasters of __FUNCTION__ at compile-time */
#define __FUNCTION__ (__func__)
#endif
确实没有KERN_ALERT的定义。
怎么会这样呢!!?
请指教? |
|