1
votes

I am New to Linux kernel , I have Module running on my Linux Machine and can see it using lsmod command ,Now I made some changes(added some printk) to this moudule ,recompiled it and got the .ko .Now I did rmmod to remove this module(some other modules also which are using this module) and did insmod xxx.ko and reboot the system .

Now where Do I see the statements added using printk ,I tried to see using

dmesg grep | "SPI RW"

But couldn't find anything .Could anybody let me know what I am doing wrong here??

1
You don't need to reboot. Just reload the module. If you reboot, the module will be reloaded from the installed module rather than your modified one. To put your module where it will be loaded at boot time (not recommended until you know it won't crash your system), run make modules_install - Peter

1 Answers

3
votes

Try vim /var/log/messages or open messages in text editor 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 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