How to flush serial buffer (pr_notice/printk) in the early kernel initialization stage

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to flush serial buffer (pr_notice/printk) in the early kernel initialization stage

3,377件の閲覧回数
davidzhou
Contributor V

Hi,

In the early stage of kernel initialization, I am using pr_notice (also printk( KERN_ALERT, etc.). When there is a udelay, for example udelay(5000), the printk messages are buffered. Can not find any way of flushing. I also tried console_unlock. It seems not working at all.

Is there any function all to flush printk immediately after the function call?

Thank you,

David Zhot

ラベル(3)
0 件の賞賛
返信
2 返答(返信)

2,966件の閲覧回数
b36401
NXP Employee
NXP Employee

Please try to perform fflush(NULL);

Have a great day,
Victor

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信

2,964件の閲覧回数
davidzhou
Contributor V

Hi Victor,

Thank you for your response.

I have tried fflush(NULL), and fflush(stdout). There is no include .h file that defines fflush(). Cannot include <linux/stdio.h>

: file not found

David

0 件の賞賛
返信