简体   繁体   English

如何查看对内核模块所做的更改

[英]How Do I see changes made to kernel Module

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 . 我是Linux内核的新手,我在我的Linux机器上运行Module并且可以使用lsmod命令查看它。现在我对这个moudule进行了一些更改(添加了一些printk),重新编译它并得到.ko。现在我做了rmmod到删除此模块(其他一些模块也使用此模块)并执行insmod xxx.ko并重新启动系统。

Now where Do I see the statements added using printk ,I tried to see using 现在我在哪里看到使用printk添加的语句,我试图看到使用

dmesg grep | dmesg grep | "SPI RW" “SPI RW”

But couldn't find anything .Could anybody let me know what I am doing wrong here?? 但找不到任何东西。难道有人让我知道我在做错了什么?

Try vim /var/log/messages or open messages in text editor verify 尝试使用vim /var/log/messages或在文本编辑器中打开消息验证

For enabling /var/log/messages 用于启用/ 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 restart rsyslog

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM