Why my kernel log is not showing the latest output?

后端 未结 1 585
误落风尘
误落风尘 2020-11-30 14:32

I\'m coding a simple kernel module, in Ubuntu 17.04, that takes a string and prints it in the kernel log.

#include
#include

        
相关标签:
1条回答
  • 2020-11-30 15:35

    Sometimes printk may defer output (that is, message is stored in the internal buffer, but not in kernel log). To avoid such behavior, always add newline (\n) at the end of the string printed:

    printk(KERN_ALERT "%s\n" ,mystring);
    
    0 讨论(0)
提交回复
热议问题