<div dir="ltr"><span style="font-family:verdana,sans-serif">Thank you so much, Thibaut. I have spotted the source-code logic in include/linux/prink.h</span><br><br>Cheers,<br> <br>Wenda Ni, Ph.D.<br><br><br><br>On Mon, Oct 17, 2016 at 7:41 PM, Thibaut SAUTEREAU &lt;<a href="mailto:thibaut.sautereau@telecom-sudparis.eu">thibaut.sautereau@telecom-sudparis.eu</a>&gt; wrote:<br>&gt; On Mon, Oct 17, 2016 at 07:17:32PM -0400, Wenda Ni wrote:<br>&gt;&gt; Dear all,<br>&gt;&gt;<br>&gt;&gt; I am working on a kernel module that incorporate both pr_debug and<br>&gt;&gt; pr_warn. I would like to see pr_debug messages from dmesg.<br>&gt;&gt;<br>&gt;&gt; What I followed is to specify kernel parameter by saying &quot;loglevel=7&quot;.<br>&gt;&gt; This can be seen confirmed  from /proc/cmdline. But still, I donot get<br>&gt;&gt; pr_debug level messages either from dmesg or from /var/log/messages. I<br>&gt;&gt; also tried echo 7 &gt; /proc/sys/kernel/printk. It does not return what I<br>&gt;&gt; expect, either.<br>&gt;&gt;<br>&gt;&gt; Let me know what I am missing. Thank you very much in advance.<br>&gt;&gt;<br>&gt;&gt; Cheers,<br>&gt;&gt;<br>&gt;&gt; Wenda Ni, Ph.D.<br>&gt;&gt;<br>&gt;&gt; _______________________________________________<br>&gt;&gt; Kernelnewbies mailing list<br>&gt;&gt; <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>&gt;&gt; <a href="https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>&gt;<br>&gt; Hello Wenda,<br>&gt;<br>&gt; I encountered the same issue a while ago.<br>&gt; As stated here: <a href="http://elinux.org/Debugging_by_printing">http://elinux.org/Debugging_by_printing</a><br>&gt; pr_debug is replaced with an empty statement unless the kernel is compiled<br>&gt; with DEBUG. So if you just want to play with printing kernel debug logs,<br>&gt; just define the DEBUG macro in your module source file for testing.<br>&gt;<br>&gt; I also observed that without a new line character at the end of the string<br>&gt; passed to pr_debug, I could not find the log line in dmesg output. Not sure<br>&gt; where this comes from.<br>&gt;<br>&gt; --<br>&gt; Thibaut SAUTEREAU<br><br></div>