linux - Kernel Module: No printk messages showing. Is init function being called? -


i have simple module, written follows:

#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h>  module_license("gpl");  static int __init hellomod_init(void) {     printk(kern_debug, "hello, world!\n");     return 0; }  static void __exit hellomod_exit(void) {     printk(kern_debug, "goodbye, world!"); }  module_init(hellomod_init); module_exit(hellomod_exit); 

and

$ cat /proc/sys/kernel/printk 7        7        7        7 

so level messages should output.

the module loads , can verified lsmod, no output produced when loading or unloading module , checking dmesg.

i have tried replacing "kern_debug" lower levels , still no output, don't think log level issue.

how else can verify init function called? if not being called, error?

i running , compiling against kernel version 4.6.1-2 on arch linux.

e: oops

there shouldn't comma after kern_debug. should this:

static int __init hellomod_init(void) {     printk(kern_debug "hello, world!\n");     return 0; } 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -