How do I see changes made to a kernel module?

345 views Asked by At

I have a module running on my Linux machine and can see it using lsmod command. Now I made some changes (added some printk) to this module, recompiled it and got the .ko.

Now I did rmmod to remove this module (some other modules also which are using this module), did insmod xxx.ko and rebooted the system.

Now where do I see the statements added using printk? I tried to see using

dmesg grep | "SPI RW"

But I couldn't find anything. What am I doing wrong here?

1

There are 1 answers

7
EnterKEY On

Try vim /var/log/messages or open messages in a text editor to verify.

For enabling /var/log/messages, edit file /etc/rsyslog.d/50-default.conf

Change the following paragraph:

...
#
# Some "catch-all" log files.
#
#*.=debug;\
#       auth,authpriv.none;\
#       news.none;mail.none     -/var/log/debug
#*.=info;*.=notice;*.=warn;\
#       auth,authpriv.none;\
#       cron,daemon.none;\
#       mail,news.none          -/var/log/messages
....

to the following:

...

#
# Some "catch-all" log files.
#
*.=debug;\
        auth,authpriv.none;\
        news.none;mail.none     -/var/log/debug
*.=info;*.=notice;*.=warn;\
        auth,authpriv.none;\
        cron,daemon.none;\
        mail,news.none          -/var/log/messages
...

and do restart rsyslog.