<div dir="ltr">Martin,<div><br><div>I'm not sure did you enable DDEBUG when compiling your module ?</div><div>pr_debug() macro is discarded if you omit DEBUG in compile time</div><div><div><br></div><div>A sample Makefile which enable pr_debug() :</div>
<div><br></div><div>obj-m += my_modue.o</div><div><br></div><div>KDIR ?= /lib/modules/`uname -r`/build</div><div>CFLAGS_my_module.o := -DDEBUG</div><div><br></div><div>all:</div><div><span class="" style="white-space:pre">        </span>make -C $(KDIR) M=$(PWD) modules</div>
<div><br></div><div>clean:</div><div><span class="" style="white-space:pre">        </span>make -C $(KDIR) M=$(PWD) clean</div></div><div><br></div></div><div>Let me know ...</div><div>regards</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Apr 16, 2014 at 1:11 PM, Martin Kepplinger <span dir="ltr"><<a href="mailto:martink@posteo.de" target="_blank">martink@posteo.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am 16.04.2014 11:58 schrieb Arun KS:<br>
<div><div class="h5">> Hi Martin,<br>
><br>
> On Wed, Apr 16, 2014 at 2:46 PM, Martin Kepplinger <<a href="mailto:martink@posteo.de">martink@posteo.de</a>><br>
> wrote:<br>
>> Am 2014-04-16 11:00, schrieb Arun KS:<br>
>>> Hi Martin,<br>
> >><br>
>>> On Wed, Apr 16, 2014 at 2:13 PM, Martin Kepplinger<br>
>>> <<a href="mailto:martink@posteo.de">martink@posteo.de</a>> wrote:<br>
>>>> I'm on Debian here and I don't really get pr_debug and<br>
>>>> printk(KERN_DEBUG<br>
> >>> ...). Let's stick to pr_debug.<br>
>>>><br>
>>>> I have DYNAMIC_DEBUG enabled and<br>
>>>> root@laptop:/proc/sys/kernel# cat /proc/sys/kernel/printk<br>
>>>> 7 7 1 7<br>
> >> This shows the console log level.<br>
>>> This file controls the traffic to console. But all the log messages<br>
>>> will be present in logbuf.<br>
>><br>
>> How do I view debug messages from logbuf?<br>
> ><br>
>>><br>
>>>><br>
>>>> I write a module with pr_debug's. I load the module and I *don't*<br>
>>>> see<br>
>>>> anything in /var/log/messages (or anywhere in /var/log/* ). Adding<br>
>>>> #define DEBUG doesn't help.<br>
> >>><br>
>>>> /sys/kernel/debug/dynamic_debug/control has the pr_debug entries I<br>
>>>> use<br>
>>>> in my loaded module.<br>
>>>><br>
>>>> In short: How do I see debug log messages? Using pr_info() works as<br>
> >>> expected. What am I missing? Do I need to edit my Makefile?<br>
>>> Did you enable dynamic printing for your file?<br>
>>><br>
>>> Below command enables dynamic printing for file sdhci.c.<br>
>>> echo 'file sdhci.c +p' > /sys/kernel/debug/dynamic_debug/control<br>
> ><br>
>> well. I tried that. The thing is, the pr_debug() symbols are in<br>
>> "control" only after "insmod my_module". Then I can echo -n 'file<br>
>> my_mobule.c +p' > control<br>
>> But my pr_debug() messages get printed directly after insmod,<br>
>> basically<br>
> > in my module_init function. Enabling my file doesn't output<br>
> anything in<br>
>> /var/log/*<br>
> So now you know why your pr_debug is absent in logbuf.<br>
><br>
> You can make your module as a built in and use bootargs.<br>
><br>
> eg:<br>
> dyndbg="file your_filename.c +p"<br>
><br>
> Thanks,<br>
> Arun<br>
><br>
<br>
</div></div>So it's *not* possible at all to get pr_debug() messages just like<br>
pr_info() messages?<br>
Of what I've read, I assumed pr_debug() is just loglevel 7.<br>
<br>
thanks for your help!<br>
<div class=""><br>
>><br>
>>><br>
>>><br>
>>> Thanks,<br>
>>> Arun<br>
>>>><br>
>>>> thanks!<br>
>>>> martin<br>
> >>><br>
>>>> --<br>
>>>> Martin Kepplinger<br>
>>>> e-mail martink AT posteo DOT at<br>
>>>> chat (XMPP) martink AT jabber DOT at<br>
>>>><br>
>>>> _______________________________________________<br>
> >>> Kernelnewbies mailing list<br>
>>>> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
</div>>>>> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a> [1]<br>
<div class="">> >><br>
>>> _______________________________________________<br>
>>> Kernelnewbies mailing list<br>
>>> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
</div>>>> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a> [1]<br>
<div class="">> >><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Kernelnewbies mailing list<br>
>> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
</div>>> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a> [1]<br>
><br>
> Links:<br>
> ------<br>
> [1] <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<div class="HOEnZb"><div class="h5">><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br></div>