Skip to contentSkip to conversation

multiple printk problem

DISCUSSION Vito Impagliazzo 1 participant 1 message Feb 19, 2004

lore
Share & tools
lore
#0 lore raw

Hi, I'm quite new to kernel module programming,
I was wondering why multiple consecutive calls to printk will not be correctly logged by the system logger (linux-2.4.25 with metalog without buffering in my case).

Consider for example the following example, only the first message can be found in logs:

   #include <linux/version.h>
   #include <linux/init.h>
   #include <linux/module.h>
   #include <linux/kernel.h>


   MODULE_AUTHOR ("Vito Impagliazzo <[email protected]>");
   MODULE_DESCRIPTION ("Hello World");
   MODULE_LICENSE("Dual BSD/GPL");

   static int hello_init(void)
   {
       printf(KERN_ALERT "1\n");
       printf(KERN_ALERT "2\n");
       printf(KERN_ALERT "3\n");
       return 0;
   }

   static void hello_exit(void)
   {
       printk(KERN_ALERT "Goodbye, cruel world\n");
   }

module_init(hello_init);
module_exit(hello_exit);

Thanks,
Vito Impagliazzo