How printk() buffering works?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I am a newbie in the world of Linux kernel. I have lots of questions
and some may be really silly. So, I will be asking a lot of questions
in the coming few months. I hope asking such questions is considered
OK here. If not, please guide me. Here is the question I have now. I
was playing with the printk() statements and how they work. I found a
strange thing.

printk(KERN_INFO "hello, world\n" KERN_INFO "hello, again\n");

Initially, I was expecting it to print "hello world" in one line and
"<6>hello, again" in the next line. But this is printing "hello,
world" and "hello, again" in two different lines. So, is it that the
printk() puts the whole message in some kernel buffer. and the kernel
searches for PRIORITY-message-newline-PRIORITY-message-newline... and
so on and prints into dmesg?

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux