ChinaUnix.net
相关文章推荐:

printk KERNEMERG

为什么我在linux-2.4.23/arch/ppc/kernel/setup.c 的early_init(int r3, int r4, int r5)函数里面加入pringk()函数一进内核就会死掉?大家能指点下吗?

by nwpuecict - 内核/嵌入技术 - 2006-09-21 23:24:59 阅读(790) 回复(0)

相关讨论

printk(KERN_INFO "Goodbye world \n"); 我查了一个KERN_INFO是个define #define KERN_INFO "<6>" 那么这个函数就等于 printk(“<6>” "Goodbye world \n"); 这个语法正确吗? [ 本帖最后由 tianlijian 于 2009-4-29 10:04 编辑 ]

by tianlijian - C/C++ - 2009-04-29 10:40:42 阅读(1510) 回复(5)

通过printk打你希望追踪的消息。从它的名字可以看出,这个东西有点类似与gnu c中的printf。不过用于内核的东西总该有些特色,printk添加了一些日志级别(loglevel),具体日志级别定义的宏在。 (printk的格式:printk(KERN_ALERT"The process is \"%s\"(pid %i)\n",current->comm,current->pid)) 。 这些宏定义的注释已经很详细了。 #define KERN_EMERG "" /* system is unusable */ #define KERN_ALERT "" /* action must...

by k_ewell - BSD文档中心 - 2008-11-28 14:12:39 阅读(1753) 回复(0)

我刚学习设备驱动的开发。看《Linux 设备驱动程序》一书的初级例子。 /*ModuleDemo.cpp*/ #include #include int init_module() { printk( "Hello module world!" ); return 0; } void cleanup_module() { printk( "Goodby cruel world!" ); } 我在Redhat下编译: g++ -I /usr/src/linux/include -g ModuleDemo.cpp -o ModuleDemo 但编译不能通过,提示: printk un...

by homegirl - 程序开发 - 2006-08-27 10:03:52 阅读(672) 回复(3)

我刚学习设备驱动的开发。看《Linux 设备驱动程序》一书的初级例子。 /*ModuleDemo.cpp*/ #include #include int init_module() { printk( "Hello module world!" ); return 0; } void cleanup_module() { printk( "Goodby cruel world!" ); } 我在Redhat下编译: g++ -I /usr/src/linux/include -g ModuleDemo.cpp -o ModuleDemo 但编译不能通过,提示: printk undeclared (first use ...

by homegirl - 内核/嵌入技术 - 2006-09-10 15:58:02 阅读(1042) 回复(7)

如何才能在模块中调用printk,编译不出现 warning: implicit declaration of function `printk'

by epegasus - C/C++ - 2006-07-03 13:44:56 阅读(1038) 回复(1)

asmlinkage int printk(const char * fmt, ...) __attribute__ ((format (printf, 1, 2))); 这个函数声明怎么理解 :asmlinkage是什么意思 __attribute__怎么理解 多谢!

by paul-luo - 程序开发 - 2006-07-27 14:18:52 阅读(1107) 回复(1)

我写了一个驱动模块,在模块内部设置了一个宏调试开关,代码如下: #define EP93_TEST_DEBUG /*debugging mode*/ #undef TEST_DBG_PRINT /* undef it, just in case */ #ifdef EP93_TEST_DEBUG /* This one if debugging is on, and kernel space */ #define TEST_DBG_PRINT(fmt, args...) printk( KERN_INFO "EP93-TEST: " fmt, ## args) #else #define TEST_DBG_PRINT(fmt, args...) /* not debugging: nothing */ #endif...

by hskun - 内核/嵌入技术 - 2006-07-04 14:44:55 阅读(762) 回复(3)

printk打印消息时,会打印出来很多乱七八糟的东西,弄的想看的信息都看不清楚,向下面这个样子: Message from syslogd@localhost at Wed Feb 15 16:05:59 2006 ... localhost kernel: *****Message length is 2. 有没有办法把多余的信息给去掉?

by wwwspirit - 内核/嵌入技术 - 2006-02-15 15:25:34 阅读(739) 回复(2)

1。我写了一个模块,要把一些debug的信息写到文件里,我知道printk可以写到文件/var/log/message中,但是我不想信息在控制台显示(printk既写到message,也把信息显示到控制台),请问,有别的方法吗? 2。如果用方法一,发现message中的信息有时候会混乱,如: 本应该是: info message 有时候是: inmesfo 我觉得是由于竞争资源引起的,有什么方法可以解决?而且让它不丢信息。 谢...

by dzbjet - Linux论坛 - 2005-01-25 12:34:05 阅读(590) 回复(0)

各位大虾,我问一下,在printk 中,格式 %Zu 和 %zu 干什么用的。谢谢

by hongbupt - C/C++ - 2008-04-02 11:32:18 阅读(1073) 回复(1)