Linux kernel networking ubuntu debug message not shown with printk/pr_debug

194 views Asked by At

I have recompiled the Linux kernel on Ubuntu and now upgraded to 4.17.6. I need to modify the TCP/IP stack parts, in specific one of the congestion control algorithms (eg. Vegas). After successful recompilation to 4.17.6, I tried to modify the code and only recompile relevant modules but can’t see any messages on the dmesg. I followed the following steps to test whether the printk and pr_debug works but none of them worked.

I added #define DEBUG on top of the modified files, then I added the following lines into desired functions net/ipv4/ip_input.c and net/ipv4/ip_output.c:

printk(KERN_DEBUG "test:");
printk("test:");
pr_debug("test:");

I ran the following commands:

sudo make -j8 net
sudo make -j8 M=net
sudo make -j8 modules SUBDIRS=net
sudo make -j8 modules_install SUBDIRS=net
sudo reboot

After reboot I modified printk file to show all message levels by executing echo 8 | sudo dd of=/proc/sys/kernel/printk. Then tried pinging from VM and to the VM and tried opening webpages. Then, tried to see message by running dmesg | grep test:

But no messages are shown, where is the problem?

0

There are 0 answers