From mboxrd@z Thu Jan 1 00:00:00 1970 From: mhornung.linux@gmail.com (mhornung.linux at gmail.com) Date: Sat, 28 Jun 2014 23:58:16 +0200 Subject: Delay in Printk Messages. In-Reply-To: <53AEFC79.2020308@gmail.com> References: <53AEFC79.2020308@gmail.com> Message-ID: <20140628215814.GA28057@googlemail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hello Arun Kumar, On Sat, 28. Jun 23:03, Arun Kumar wrote: > I am able to read my printk messages in the kernel buffer only after > unloading the module.. > Is there some reason or configuration behind this. > > I used a simple kernel module with only init and exit functions, and > after loading the module i cannot see the message printed by the > "module_init" function in the output given by "dmesg -c" I can see them > only after i unload the module. > Since you do not provide your code I have to guess that your print statement looks like this: pr_debug("Hello World!"); Please notice that printk doesn't flush until a trailing newline is provided (Linux Device Drivers Chapter 4). So maybe this is what you want: pr_debug("Hello World!\n"); > i wait for around 15-20 seconds for the init message but it only shows > up on removing the module. > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies at kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies With best regards Michael Hornung