Re: Delay in Printk Messages.
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@kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies With best regards Michael Hornung ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Delay in Printk Messages.
Try echo "7" > /proc/sys/kernel/printk to enable all console log levels. The numbers are corresponding to below: #define KERN_EMERG "<0>" /* system is unusable*/ #define KERN_ALERT "<1>" /* action must be taken immediately*/ #define KERN_CRIT "<2>" /* critical conditions*/ #define KERN_ERR "<3>" /* error conditions*/ #define KERN_WARNING "<4>" /* warning conditions*/ #define KERN_NOTICE "<5>" /* normal but significant condition*/ #define KERN_INFO "<6>" /* informational*/ #define KERN_DEBUG "<7>" /* debug-level messages*/ The default number is 4, which allows console to show messages only at least in KERN_WARNING. That could be why you cannot see log in KERN_INFO level. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Delay in Printk Messages.
Try 'sysctl kernel.printk=7' where 7 is one of the levels defined in "include/linux/kern_levels.h". On Sat, Jun 28, 2014 at 7:33 PM, 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. > > i wait for around 15-20 seconds for the init message but it only shows > up on removing the module. > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies