- 招聘 : c/c++研发
- 论坛徽章:
- 0
|
原帖由 albcamus 于 2008-3-14 14:49 发表 ![]()
不要用tail -f, 用dmesg吧,还没有?
- #include <linux/module.h> // Needed by all modules
- #include <linux/kernel.h> // Needed for KERN_ALERT
- #include <linux/init.h> // Needed for the macros
- MODULE_LICENSE("GPL");
- static int i=0;
- static int __init hello_2_init(void)
- {
- i=1;
- printk(KERN_EMERG"Hello, world 2\n");
- return 0;
- }
- static void hello_2_exit(void)
- {
- printk(KERN_ALERT"Goodbye, world 2,i=%d\n",i);
- }
- module_init(hello_2_init);
- module_exit(hello_2_exit);
-
复制代码
用dmesg结果一样,我改了下代码增加一个监控变量,结果日志中记录如下
Goodbye, world 2,i=0
显然hello_2_init()根本没被调用 |
|