question about pr_info (newbie)
Kevin Wilson
wkevils at gmail.com
Mon Dec 29 04:32:22 EST 2014
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
More information about the Kernelnewbies
mailing list