K
K
k-morozov2019-07-13 21:57:52
linux
k-morozov, 2019-07-13 21:57:52

Printk can output a line to the logs?

I can't figure out why printk doesn't output message. Outputs test and (null). look in var/log/syslog

#include <linux/module.h>

extern void call_me(const char* message) {
        printk(KERN_INFO "test: %s", *(message) );
}
EXPORT_SYMBOL (call_me);

int init_module(void) {
        const char msg[] = "Hello from my module!";
        call_me(msg);
}

void cleanup_module(void) {
        printk(KERN_INFO "my module off");
}
MODULE_LICENSE("GPL");

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question