免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 809 | 回复: 0
打印 上一主题 下一主题

关于printk [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-06-12 13:59 |只看该作者 |倒序浏览
2008.06.12.
  printk可以在任何上下文中调用。如果拿不到console_sem,就写入buffer后返回。推迟输出。推迟可能导致log level的变化。见代码注释。
/*
* This is printk.  It can be called from any context.  We want it to work.
*
* We try to grab the console_sem.  If we succeed, it's easy - we log the output and
* call the console drivers.  If we fail to get the semaphore we place the output
* into the log buffer and return.  The current holder of the console_sem will
* notice the new output in release_console_sem() and will send it to the
* consoles before releasing the semaphore.
*
* One effect of this deferred printing is that code which calls printk() and
* then changes console_loglevel may break. This is because console_loglevel
* is inspected when the actual printing occurs.
*/
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/12325/showart_972716.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP