You are not logged in.

#1 2013-06-20 11:28:57

gundamfj
Member
Registered: 2012-01-02
Posts: 21

Cann't display printk messages on screen

I write a small module to test log level.

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

static int hello_init(void) 
{
 printk(KERN_ALERT "Hello, world \n ");
 return 0; 
} 

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

module_init(hello_init);
module_exit(hello_exit);

And I change the current log level to 7, which is KERN_DEBUG, the lowest log level.

echo 7 > /proc/sys/kernel/printk

BUT when the module is loaded, instead of displaying the message on screen, it only append the message to /var/log/messages.

Offline

#2 2013-06-20 12:24:56

zezadas
Member
Registered: 2013-04-11
Posts: 35

Re: Cann't display printk messages on screen

maybe its some kernel configuration...

Offline

Board footer

Powered by FluxBB