public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* multiple printk problem
@ 2004-02-19 10:11 Vito Impagliazzo
  0 siblings, 0 replies; 2+ messages in thread
From: Vito Impagliazzo @ 2004-02-19 10:11 UTC (permalink / raw)
  To: linux-kernel

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 <vimpagliazzo@libero.it>");
    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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: multiple printk problem
       [not found] <20040528165600.1971fdc0.rddunlap@osdl.org>
@ 2004-05-29  2:38 ` Randy.Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy.Dunlap @ 2004-05-29  2:38 UTC (permalink / raw)
  To: vimpagliazzo; +Cc: lkml


| 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 <vimpagliazzo@libero.it>");
|     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);

Hi,

Your module works fine if you change "printf" to "printk".

If you still fail to see all 3 messages, it's a metalog
problem and not a kernel problem.
You should be able to contact them at
	http://sourceforge.net/projects/metalog/

--
~Randy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-05-29  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-19 10:11 multiple printk problem Vito Impagliazzo
     [not found] <20040528165600.1971fdc0.rddunlap@osdl.org>
2004-05-29  2:38 ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox