question about pr_info (newbie)

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

 



Hi,

I have the following very simply kernel module.
The module_init() method has one call to pr_info("Hello world!\n").
However, when I run "insmod helloWorld.ko" I get TWO messages in the
kernel log and not one, as I expected:

..
Dec 29 11:24:40 kv kernel: [67479.245642] Hello world!
Dec 29 11:24:40 kv kernel: Hello world!
...

The same is for "rmmod helloWorld" (TWO messages instead of one)

I built and run this module under kernel 3.17.6-300.fc21.x86_64, Fedora 21.
Any ideas ? Is there some way to configure the kernel to emit only one
message in such a case ?

Following is the code:

static int __init hello_init(void)
{
        pr_info("Hello world!\n");
        return 0;
ded.
}

static void __exit hello_cleanup(void)
        {
        pr_info("Cleaning up module.\n");
        }

module_init(hello_init);
module_exit(hello_cleanup);


Regards,
Kevin

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[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