printk(KERN_INFO fmt,##arg)语句中的##arg是什么意思啊?在网上找了很久没有得到解析,特来问各位大侠!谢谢!
by luozhao1984 - 驱动开发 - 2010-05-03 22:35:16 阅读(2421) 回复(4)
今天看ldd2看到printk中的格式字符串中有一个是%p,不知道是什么意思,请教大家了! ssize_t faulty_read (struct file *filp, char *buf, size_t count, loff_t *pos) { int ret, ret2; char stack_buf[4]; printk(KERN_DEBUG "read: buf %p, count %li\n", buf, (long)count); /* the next line oopses with 2.0, but not with 2.2 and later */ ret = copy_to_user(buf, faulty_buf, count); if (!re...
今天看ldd2看到printk中的格式字符串中有一个是%p,不知道是什么意思,请教大家了! ssize_t faulty_read (struct file *filp, char *buf, size_t count, loff_t *pos) { int ret, ret2; char stack_buf[4]; printk(KERN_DEBUG "read: buf %p, count %li\n", buf, (long)count); /* the next line oopses with 2.0, but not with 2.2 and later */ ret = copy_to_user(buf, faulty_buf, count); if (!re...
代码如下: struct tvp514x_std_info { unsigned long width; unsigned long height; u8 video_std; struct v4l2_standard standard; }; static struct tvp514x_reg tvp514x_reg_list_default[0x40]; static int tvp514x_s_stream(struct v4l2_subdev *sd, int enable); printk(KERN_EMERG " aaaaaaaaaaaaaaaaaaaaaaa %d \n"); 求助各位,为什么我的printk打印信息在超级终端看不到呢?是不是我打印的位置不对呢?
各位大虾: 小弟最近在学习内核编程, 并且动手修改了一个函数--kernel/printk.c中的tty_write_message函数: /** * tty_write_message - write a message to a certain tty, not just the console. * * This is used for messages that need to be redirected to a specific tty. * We don't put it into the syslog queue right now maybe in the future if * really needed. */ void tty_write_message(struct tty_struct *...
我在内核的fork中加个printk("ok");编译没问题,可是运行是进不了系统,请问只要打印一个字符调试信息,用printk不行吗?要是不行,要打印信息用什么语句。我的是ARM2410上的ARMLinux,其实和Linux一样的。
我在内核的fork中加个printk("ok");编译没问题,可是运行是进不了系统,请问只要打印一个字符调试信息,用printk不行吗?要是不行,要打印信息用什么语句。我的是ARM2410上的ARMLinux,其实和Linux一样的。
本帖最后由 shihyu 于 2012-05-28 22:42 编辑 我trace kernel device 代码, device 挂在list 函数指针 , 所以我把函数指针存再 unsigned long int addr_tmp[436]; list 上一共有 436 个.. 所以我用for 打印 for (i = 0; i < 436; i++) { printk(KERN_INFO"addr_tmp"); } 不过实际上打印出来不到100个函数地址~请问是因为printk 不能快速打印吗? 有什么办法可以解决~这问题困扰我很久~ 谢谢
printk信息打印 printk是内核态信息打印函数,功能和比准C库的printf类似。 printk还有信息打印级别。 函数原型: int printk(const char *fmt, ...) 需要的头文件: #include linux/kernel.h> 消息打印级别: fmt----消息级别: #define KERN_EMERG "" /* system is unusable */ #define KERN_ALERT "" /* action must be taken immediately */ #define KERN_CRIT "" /* critical conditions */ #define KER...
在编译linux内核时,选择了Show timing information on printks 强制为内核信息增加时间戳 可是我看了printk的打印信息,为什么printk不是从0开始的?它一开始就从1717xxxx这个8位数开始打印的? 怎么回事?