Hi Wenda Ni, Please go through the following link to enable debugging output.Seems you have missed enabling DEBUG in Makefile. Hope it will help you. https://www.kernel.org/doc/local/pr_debug.txt *CFLAGS_[filename].o := -DDEBUG* *With Best Regards,* Sukanya Ch Software Engineer VVDN Technologies Pvt Ltd *Cell : *+91 9551955031 | *Skype :* sukanya.chinthamreddy On Tue, Oct 18, 2016 at 7:44 PM, <kernelnewbies-request@kernelnewbies.org> wrote:
Send Kernelnewbies mailing list submissions to kernelnewbies@kernelnewbies.org
To subscribe or unsubscribe via the World Wide Web, visit https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies or, via email, send a message with subject or body 'help' to kernelnewbies-request@kernelnewbies.org
You can reach the person managing the list at kernelnewbies-owner@kernelnewbies.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Kernelnewbies digest..."
Today's Topics:
1. kernel loglevel (Wenda Ni) 2. Re: kernel loglevel (Wenda Ni) 3. Re: kernel loglevel (Joel Fernandes) 4. Re: kernel loglevel (Thibaut SAUTEREAU) 5. Re: kernel loglevel (Wenda Ni) 6. Fw: TPS65910 Regulator Isuue (Amit Mahadik)
----------------------------------------------------------------------
Message: 1 Date: Mon, 17 Oct 2016 19:17:32 -0400 From: Wenda Ni <wonda.ni@gmail.com> Subject: kernel loglevel To: kernelnewbies@kernelnewbies.org Message-ID: <CAEnvTt0RRDWtMD=VxVpuhiiJ+MRX2g3WiTgXkA-M5GGaTMyB-g@ mail.gmail.com> Content-Type: text/plain; charset=UTF-8
Dear all,
I am working on a kernel module that incorporate both pr_debug and pr_warn. I would like to see pr_debug messages from dmesg.
What I followed is to specify kernel parameter by saying "loglevel=7". This can be seen confirmed from /proc/cmdline. But still, I donot get pr_debug level messages either from dmesg or from /var/log/messages. I also tried echo 7 > /proc/sys/kernel/printk. It does not return what I expect, either.
Let me know what I am missing. Thank you very much in advance.
Cheers,
Wenda Ni, Ph.D.
------------------------------
Message: 2 Date: Mon, 17 Oct 2016 19:47:14 -0400 From: Wenda Ni <wonda.ni@gmail.com> Subject: Re: kernel loglevel To: Thibaut SAUTEREAU <thibaut.sautereau@telecom-sudparis.eu> Cc: kernelnewbies@kernelnewbies.org Message-ID: <CAEnvTt3oh+tuhKCwho8eZd5VmJfuXdcmWGpUpsji H2wWSFpWvg@mail.gmail.com> Content-Type: text/plain; charset="utf-8"
Thank you so much, Thibaut. I have spotted the source-code logic in include/linux/prink.h
Cheers,
Wenda Ni, Ph.D.
On Mon, Oct 17, 2016 at 7:41 PM, Thibaut SAUTEREAU < thibaut.sautereau@telecom-sudparis.eu> wrote:
On Mon, Oct 17, 2016 at 07:17:32PM -0400, Wenda Ni wrote:
Dear all,
I am working on a kernel module that incorporate both pr_debug and pr_warn. I would like to see pr_debug messages from dmesg.
What I followed is to specify kernel parameter by saying "loglevel=7". This can be seen confirmed from /proc/cmdline. But still, I donot get pr_debug level messages either from dmesg or from /var/log/messages. I also tried echo 7 > /proc/sys/kernel/printk. It does not return what I expect, either.
Let me know what I am missing. Thank you very much in advance.
Cheers,
Wenda Ni, Ph.D.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hello Wenda,
I encountered the same issue a while ago. As stated here: http://elinux.org/Debugging_by_printing pr_debug is replaced with an empty statement unless the kernel is compiled with DEBUG. So if you just want to play with printing kernel debug logs, just define the DEBUG macro in your module source file for testing.
I also observed that without a new line character at the end of the string passed to pr_debug, I could not find the log line in dmesg output. Not sure where this comes from.
-- Thibaut SAUTEREAU
participants (1)
-
Sukanya Ch