linux kernel - dmesg is not showing printk statement -


i'm trying create proc entry. init_module function below

int init_module() { printk(kern_info "proc2:module loaded\n"); proc_entry=proc_create_data(proc_name,0644,null,&fops,null); if(proc_entry==null) {     printk(kern_info "proc2:error registering proc entry"); } else {     printk(kern_info "proc2:proc entry created"); } return 0; } 

following cleanup method

void cleanup_module() { printk(kern_info "proc2:module unloaded"); remove_proc_entry(proc_name,proc_entry); } 

rest of program include variable definition , callback functions.

when compile program compiles well. when use insmod doesn't reply me prompt. lsmod lists module , shows used 1 (don't know what). dmesg shows none of above printk messages.

can tell me what's wrong here?

try echo "7" > /proc/sys/kernel/printk enable console log levels.

the numbers corresponding below:

#define kern_emerg "<0>" /* system unusable*/ #define kern_alert "<1>" /* action must taken immediately*/ #define kern_crit "<2>" /* critical conditions*/ #define kern_err "<3>" /* error conditions*/ #define kern_warning "<4>" /* warning conditions*/ #define kern_notice "<5>" /* normal significant condition*/ #define kern_info "<6>" /* informational*/ #define kern_debug "<7>" /* debug-level messages*/ 

the default number 4, allows console show messages @ least in kern_warning. that's why cannot see log in kern_info level.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -