loglevel 7 (debug) and pr_debug()
I'm on Debian here and I don't really get pr_debug and printk(KERN_DEBUG ...). Let's stick to pr_debug.
I have DYNAMIC_DEBUG enabled and
root at laptop:/proc/sys/kernel# cat /proc/sys/kernel/printk
7 7 1 7
I write a module with pr_debug's. I load the module and I *don't* see anything in /var/log/messages (or anywhere in /var/log/* ). Adding #define DEBUG doesn't help.
/sys/kernel/debug/dynamic_debug/control has the pr_debug entries I use in my loaded module.
In short: How do I see debug log messages? Using pr_info() works as expected. What am I missing? Do I need to edit my Makefile?
thanks!
martin
Signature · 3 lines
Martin Kepplinger e-mail martink AT posteo DOT at chat (XMPP) martink AT jabber DOT at
Hi Martin,
Quoted 6 lines · Martin Kepplinger
I'm on Debian here and I don't really get
pr_debugandprintk(KERN_DEBUG ...). Let's stick topr_debug.I have
DYNAMIC_DEBUGenabled and
root at laptop:/proc/sys/kernel# cat/proc/sys/kernel/printk
7 7 1 7
This shows the console log level.
This file controls the traffic to console. But all the log messages will be present in logbuf.
Quoted 10 lines
I write a module with pr_debug's. I load the module and I *don't* see anything in
/var/log/messages(or anywhere in/var/log/*). Adding #define DEBUG doesn't help.
/sys/kernel/debug/dynamic_debug/controlhas thepr_debugentries I use in my loaded module.In short: How do I see debug log messages? Using
pr_info()works as expected. What am I missing? Do I need to edit myMakefile?
Did you enable dynamic printing for your file?
Below command enables dynamic printing for file sdhci.c. echo 'file sdhci.c +p' > /sys/kernel/debug/dynamic_debug/control
Thanks,
Arun
Quoted 13 lines
thanks!
martin--
Martin Kepplinger
e-mail martink AT posteo DOT at
chat (XMPP) martink AT jabber DOT at_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Am 2014-04-16 11:00, schrieb Arun KS:
Quoted 6 lines
Hi Martin,
Quoted 3 lines · Martin Kepplinger
I'm on Debian here and I don't really get
pr_debugandprintk(KERN_DEBUG ...). Let's stick topr_debug.
Quoted 6 lines
Quoted 3 lines
I have
DYNAMIC_DEBUGenabled and
root at laptop:/proc/sys/kernel# cat/proc/sys/kernel/printk
7 7 1 7This shows the console log level.
This file controls the traffic to console. But all the log messages will be present in logbuf.
How do I view debug messages from logbuf?
Quoted 9 lines
Quoted 9 lines
I write a module with pr_debug's. I load the module and I *don't* see anything in
/var/log/messages(or anywhere in/var/log/*). Adding #define DEBUG doesn't help.
/sys/kernel/debug/dynamic_debug/controlhas thepr_debugentries I use in my loaded module.
Quoted 6 lines
Quoted 2 lines
In short: How do I see debug log messages? Using
pr_info()works as expected. What am I missing? Do I need to edit myMakefile?Did you enable dynamic printing for your file?
Below command enables dynamic printing for file
sdhci.c. echo 'filesdhci.c+p' >/sys/kernel/debug/dynamic_debug/control
well. I tried that. The thing is, the pr_debug() symbols are in "control" only after "insmod my_module". Then I can echo -n 'file my_mobule.c +p' > control
But my pr_debug() messages get printed directly after insmod, basically in my module_init function. Enabling my file doesn't output anything in /var/log/*
Quoted 23 lines
Thanks,
ArunQuoted 9 lines
thanks!
martin--
Martin Kepplinger
e-mail martink AT posteo DOT at
chat (XMPP) martink AT jabber DOT atQuoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi Martin,
Quoted 4 lines · Martin Kepplinger
Am 2014-04-16 11:00, schrieb Arun KS:
Quoted 3 lines
Hi Martin,
On Wed, Apr 16, 2014 at 2:13 PM, Martin Kepplinger <[email protected]>
Quoted 28 lines · wrote:
Quoted 9 lines
Quoted 6 lines
I'm on Debian here and I don't really get
pr_debugandprintk(KERN_DEBUG ...). Let's stick topr_debug.I have
DYNAMIC_DEBUGenabled and
root at laptop:/proc/sys/kernel# cat/proc/sys/kernel/printk
7 7 1 7This shows the console log level.
This file controls the traffic to console. But all the log messages will be present in logbuf.How do I view debug messages from logbuf?
Quoted 9 lines
Quoted 9 lines
I write a module with pr_debug's. I load the module and I *don't* see anything in
/var/log/messages(or anywhere in/var/log/*). Adding #define DEBUG doesn't help.
/sys/kernel/debug/dynamic_debug/controlhas thepr_debugentries I use in my loaded module.Quoted 6 lines
Quoted 2 lines
In short: How do I see debug log messages? Using
pr_info()works as expected. What am I missing? Do I need to edit myMakefile?Did you enable dynamic printing for your file?
Below command enables dynamic printing for file
sdhci.c. echo 'filesdhci.c+p' >/sys/kernel/debug/dynamic_debug/control
Quoted 6 lines
well. I tried that. The thing is, the
pr_debug()symbols are in "control" only after "insmodmy_module". Then I can echo -n 'filemy_mobule.c+p' > control
But mypr_debug()messages get printed directly after insmod, basically in mymodule_initfunction. Enabling my file doesn't output anything in/var/log/*
So now you know why your pr_debug is absent in logbuf.
You can make your module as a built in and use bootargs.
eg:
dyndbg="file your_filename.c +p"
Thanks,
Arun
Quoted 26 lines
Quoted 19 lines
Thanks,
ArunQuoted 9 lines
thanks!
martin--
Martin Kepplinger
e-mail martink AT posteo DOT at
chat (XMPP) martink AT jabber DOT atQuoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbiesQuoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Quoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140416/a8e4198a/attachment.html
Am 16.04.2014 11:58 schrieb Arun KS:
Quoted 50 lines
Hi Martin,
Quoted 36 lines · Martin Kepplinger
Am 2014-04-16 11:00, schrieb Arun KS:
Quoted 8 lines
Hi Martin,
Quoted 4 lines · Martin Kepplinger
I'm on Debian here and I don't really get
pr_debugand printk(KERN_DEBUG
...). Let's stick topr_debug.Quoted 6 lines
Quoted 3 lines
I have
DYNAMIC_DEBUGenabled and
root at laptop:/proc/sys/kernel# cat/proc/sys/kernel/printk7 ? ? ? 7 ? ? ? 1 ? ? ? 7This shows the console log level.
This file controls the traffic to console. But all the log messages will be present in logbuf.How do I view debug messages from logbuf?
Quoted 11 lines
Quoted 11 lines
I write a module with pr_debug's. I load the module and I *don't* see
anything in/var/log/messages(or anywhere in/var/log/*). Adding #define DEBUG doesn't help.
/sys/kernel/debug/dynamic_debug/controlhas thepr_debugentries I use
in my loaded module.Quoted 6 lines
Quoted 2 lines
In short: How do I see debug log messages? Using
pr_info()works as expected. What am I missing? Do I need to edit myMakefile?Did you enable dynamic printing for your file?
Below command enables dynamic printing for file
sdhci.c. echo 'filesdhci.c+p' >/sys/kernel/debug/dynamic_debug/controlQuoted 6 lines
well. I tried that. The thing is, the
pr_debug()symbols are in "control" only after "insmodmy_module". Then I can echo -n 'filemy_mobule.c+p' > control
But mypr_debug()messages get printed directly after insmod, basically
in mymodule_initfunction. Enabling my file doesn't outputanything in
Quoted 1 line
/var/log/*So now you know why your
pr_debugis absent in logbuf.
Quoted 8 lines
You can make your module as a built in and use bootargs.
eg:
dyndbg="fileyour_filename.c+p"Thanks,
Arun
So it's *not* possible at all to get pr_debug() messages just like pr_info() messages?
Of what I've read, I assumed pr_debug() is just loglevel 7.
thanks for your help!
Quoted 39 lines
Quoted 26 lines
Quoted 19 lines
Thanks,
ArunQuoted 9 lines
thanks!
? ? ? ? ? ? ? ? ? ? ?martin--
Martin Kepplinger
e-mail ? ? ? ?martink AT posteo DOT at
chat (XMPP) ? martink AT jabber DOT atQuoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Links:
------
[1] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Martin,
I'm not sure did you enable DDEBUG when compiling your module ? pr_debug() macro is discarded if you omit DEBUG in compile time
A sample Makefile which enable pr_debug() :
obj-m += my_modue.o
KDIR ?= /lib/modules/uname -r/build
CFLAGS_my_module.o := -DDEBUG
all:
make -C $(KDIR) M=$(PWD) modules
clean:
make -C $(KDIR) M=$(PWD) clean
Let me know ...
regards
Quoted 106 lines · Martin Kepplinger
Am 16.04.2014 11:58 schrieb Arun KS:
Quoted 50 lines
Hi Martin,
Quoted 36 lines · Martin Kepplinger
Am 2014-04-16 11:00, schrieb Arun KS:
Quoted 8 lines
Hi Martin,
Quoted 4 lines · Martin Kepplinger
I'm on Debian here and I don't really get
pr_debugand printk(KERN_DEBUG
...). Let's stick topr_debug.Quoted 6 lines
Quoted 3 lines
I have
DYNAMIC_DEBUGenabled and
root at laptop:/proc/sys/kernel# cat/proc/sys/kernel/printk
7 7 1 7This shows the console log level.
This file controls the traffic to console. But all the log messages will be present in logbuf.How do I view debug messages from logbuf?
Quoted 11 lines
Quoted 11 lines
I write a module with pr_debug's. I load the module and I *don't* see
anything in/var/log/messages(or anywhere in/var/log/*). Adding #define DEBUG doesn't help.
/sys/kernel/debug/dynamic_debug/controlhas thepr_debugentries I use
in my loaded module.Quoted 6 lines
Quoted 2 lines
In short: How do I see debug log messages? Using
pr_info()works as expected. What am I missing? Do I need to edit myMakefile?Did you enable dynamic printing for your file?
Below command enables dynamic printing for file
sdhci.c. echo 'filesdhci.c+p' >/sys/kernel/debug/dynamic_debug/controlQuoted 6 lines
well. I tried that. The thing is, the
pr_debug()symbols are in "control" only after "insmodmy_module". Then I can echo -n 'filemy_mobule.c+p' > control
But mypr_debug()messages get printed directly after insmod, basically
in mymodule_initfunction. Enabling my file doesn't outputanything in
Quoted 1 line
/var/log/*So now you know why your
pr_debugis absent in logbuf.Quoted 8 lines
You can make your module as a built in and use bootargs.
eg:
dyndbg="fileyour_filename.c+p"Thanks,
ArunSo it's *not* possible at all to get
pr_debug()messages just likepr_info()messages?
Of what I've read, I assumedpr_debug()is just loglevel 7.thanks for your help!
Quoted 31 lines
Quoted 26 lines
Quoted 19 lines
Thanks,
ArunQuoted 9 lines
thanks!
martin--
Martin Kepplinger
e-mail martink AT posteo DOT at
chat (XMPP) martink AT jabber DOT atQuoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 8 lines
Links:
------
[1] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Quoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140416/97152030/attachment-0001.html
Am 16.04.2014 13:43 schrieb Denis Pithon:
Quoted 12 lines
Martin,
I'm not sure did you enable DDEBUG when compiling your module ?
pr_debug()macro is discarded if you omit DEBUG in compile timeA sample
Makefilewhich enablepr_debug():obj-m += my_modue.o
KDIR ?=
/lib/modules/uname -r/build
CFLAGS_my_module.o := -DDEBUG
Quoted 8 lines
all:
make -C $(KDIR) M=$(PWD) modulesclean:
make -C $(KDIR) M=$(PWD) cleanLet me know ...
regards
Thanks,
I did not, but now added -DDEBUG. The exact line is:
CFLAGS_my_module.o := -DDEBUG
when "my_module.o" is my object file. Did I get that right?
That doesn't change anything unfortunately. I can not read pr_debug() unless I
explicitely activate it in /sys/kernel/debug/dynamic_debug/control *after* insmod.
I'd like to just read all pr_debug() messages like pr_info().
thanks for your time!
Quoted 138 lines
Quoted 119 lines · Martin Kepplinger
Am 16.04.2014 11:58 schrieb Arun KS:
Quoted 55 lines
Hi Martin,
Quoted 2 lines · Martin Kepplinger
Am 2014-04-16 11:00, schrieb Arun KS:
Quoted 1 line
Hi Martin,
?>>
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines · Martin Kepplinger
I'm on Debian here and I don't really get
pr_debugand printk(KERN_DEBUG?>>> ...). Let's stick to
pr_debug.Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
I have
DYNAMIC_DEBUGenabled and
root at laptop:/proc/sys/kernel# cat/proc/sys/kernel/printk7 ? ? ? 7 ? ? ? 1 ? ? ? 7?>> This shows the console log level.
Quoted 5 lines
Quoted 3 lines
This file controls the traffic to console. But all the log messages
will be present in logbuf.How do I view debug messages from logbuf?
?>
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
I write a module with pr_debug's. I load the module and I *don't* see
anything in/var/log/messages(or anywhere in/var/log/*). Adding
#define DEBUG doesn't help.?>>>
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
/sys/kernel/debug/dynamic_debug/controlhas thepr_debugentries I
use
in my loaded module.In short: How do I see debug log messages? Using
pr_info()works as?>>> expected. What am I missing? Do I need to edit my
Makefile?Quoted 4 lines
Quoted 4 lines
Did you enable dynamic printing for your file?
Below command enables dynamic printing for file
sdhci.c. echo 'filesdhci.c+p' >/sys/kernel/debug/dynamic_debug/control?>
Quoted 5 lines
well. I tried that. The thing is, the
pr_debug()symbols are in "control" only after "insmodmy_module". Then I can echo -n 'filemy_mobule.c+p' > control
But mypr_debug()messages get printed directly after insmod, basically?> in my
module_initfunction. Enabling my file doesn't output anything inQuoted 1 line
/var/log/*So now you know why your
pr_debugis absent in logbuf.Quoted 8 lines
You can make your module as a built in and use bootargs.
eg:
dyndbg="fileyour_filename.c+p"Thanks,
ArunSo it's *not* possible at all to get
pr_debug()messages just likepr_info()messages?
Of what I've read, I assumedpr_debug()is just loglevel 7.thanks for your help!
Quoted 42 lines
Quoted 8 lines
Quoted 8 lines
Thanks,
ArunQuoted 3 lines
thanks!
? ? ? ? ? ? ? ? ? ? ?martin?>>>
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
--
Martin Kepplinger
e-mail ? ? ? ?martink AT posteo DOT at
chat (XMPP) ? martink AT jabber DOT at_______________________________________________
?>>> Kernelnewbies mailing list
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]
[1]?>>
Quoted 5 lines
Quoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]
[1]?>>
Quoted 7 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]
[1]Links:
------
[1] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
[1]Quoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Links:
------
[1] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hello Martin and Dennis,
Quoted 24 lines · Martin Kepplinger
Am 16.04.2014 13:43 schrieb Denis Pithon:
Quoted 12 lines
Martin,
I'm not sure did you enable DDEBUG when compiling your module ?
pr_debug()macro is discarded if you omit DEBUG in compile timeA sample
Makefilewhich enablepr_debug():obj-m += my_modue.o
KDIR ?=
/lib/modules/uname -r/build
CFLAGS_my_module.o := -DDEBUGQuoted 8 lines
all:
make -C $(KDIR) M=$(PWD) modulesclean:
make -C $(KDIR) M=$(PWD) cleanLet me know ...
regardsThanks,
Quoted 9 lines
I did not, but now added -DDEBUG. The exact line is:
CFLAGS_my_module.o := -DDEBUG
when "my_module.o" is my object file. Did I get that right?That doesn't change anything unfortunately. I can not read
pr_debug()unless I
explicitely activate it in/sys/kernel/debug/dynamic_debug/control*after* insmod.
Adding -DDEBUG will not change anything if CONFIG_DYNAMIC_DEBUG is defined in your .config
The reason is because CONFIG_DYNAMIC_DEBUG has priority over DEBUG.
File:include/linux/printk.h --------------------------stripped------------------------------- #if defined(CONFIG_DYNAMIC_DEBUG)
/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
#define pr_debug(fmt, ...) \
dynamic_pr_debug(fmt, ##__VA_ARGS__)
#elif defined(DEBUG)
#define pr_debug(fmt, ...) \
printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#else
#define pr_debug(fmt, ...) \
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)#endif --------------------------stripped-------------------------------
So the quick way is to disable CONFIG_DYNAMIC_DEBUG and add -DDEBUG in your makefile.
Thanks,
Arun
Quoted 144 lines
I'd like to just read all
pr_debug()messages likepr_info().thanks for your time!
Quoted 130 lines
Quoted 119 lines · Martin Kepplinger
Am 16.04.2014 11:58 schrieb Arun KS:
Quoted 55 lines
Hi Martin,
Quoted 40 lines · Martin Kepplinger
Am 2014-04-16 11:00, schrieb Arun KS:
Quoted 8 lines
Hi Martin,
Quoted 4 lines · Martin Kepplinger
I'm on Debian here and I don't really get
pr_debugand printk(KERN_DEBUG
...). Let's stick topr_debug.Quoted 7 lines
Quoted 3 lines
I have
DYNAMIC_DEBUGenabled and
root at laptop:/proc/sys/kernel# cat/proc/sys/kernel/printk
7 7 1 7This shows the console log level.
This file controls the traffic to console. But all the log messages
will be present in logbuf.How do I view debug messages from logbuf?
Quoted 13 lines
Quoted 13 lines
I write a module with pr_debug's. I load the module and I *don't* see
anything in/var/log/messages(or anywhere in/var/log/*). Adding
#define DEBUG doesn't help.
/sys/kernel/debug/dynamic_debug/controlhas thepr_debugentries I
use
in my loaded module.Quoted 7 lines
Quoted 3 lines
In short: How do I see debug log messages? Using
pr_info()works as
expected. What am I missing? Do I need to edit myMakefile?Did you enable dynamic printing for your file?
Below command enables dynamic printing for file
sdhci.c. echo 'filesdhci.c+p' >/sys/kernel/debug/dynamic_debug/controlQuoted 6 lines
well. I tried that. The thing is, the
pr_debug()symbols are in "control" only after "insmodmy_module". Then I can echo -n 'filemy_mobule.c+p' > control
But mypr_debug()messages get printed directly after insmod, basically
in mymodule_initfunction. Enabling my file doesn't outputanything in
Quoted 1 line
/var/log/*So now you know why your
pr_debugis absent in logbuf.Quoted 8 lines
You can make your module as a built in and use bootargs.
eg:
dyndbg="fileyour_filename.c+p"Thanks,
ArunSo it's *not* possible at all to get
pr_debug()messages just likepr_info()messages?
Of what I've read, I assumedpr_debug()is just loglevel 7.thanks for your help!
Quoted 42 lines
Quoted 30 lines
Quoted 21 lines
Thanks,
ArunQuoted 9 lines
thanks!
martin--
Martin Kepplinger
e-mail martink AT posteo DOT at
chat (XMPP) martink AT jabber DOT atQuoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]
[1]Quoted 7 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]
[1]Quoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]
[1]Links:
------
[1] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
[1]Quoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 8 lines
Links:
------
[1] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Quoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140416/2c7ededd/attachment.html
Quoted 1 line · Martin Kepplinger
I'd like to just read all
pr_debug()messages likepr_info().
Did you consider, um, I don't know? Just building a kernel that doesn't have CONFIG_DYNAMIC_DEBUG turned on?
Or you could read Documentation/dynamic-debug-howto.txt, and find this:
Debug Messages at Module Initialization Time
============================================
When "modprobe foo" is called, modprobe scans /proc/cmdline for foo.params, strips "foo.", and passes them to the kernel along with params given in modprobe args or /etc/modprob.d/*.conf files, in the following order:
1. # parameters given via /etc/modprobe.d/*.conf
options foo dyndbg=+pt
options foo dyndbg # defaults to +p
2. # foo.dyndbg as given in boot args, "foo." is stripped and passed foo.dyndbg=" func bar +p; func buz +mp"
3. # args to modprobe
modprobe foo dyndbg==pmf # override previous settings
These dyndbg queries are applied in order, with last having final say. This allows boot args to override or modify those from /etc/modprobe.d (sensible, since 1 is system wide, 2 is kernel or boot specific), and modprobe args to override both.
In the foo.dyndbg="QUERY" form, the query must exclude "module foo". "foo" is extracted from the param-name, and applied to each query in "QUERY", and only 1 match-spec of each type is allowed.
The dyndbg option is a "fake" module parameter, which means:
- modules do not need to define it explicitly
- every module gets it tacitly, whether they use pr_debug or not
- it doesn't appear in /sys/module/$module/parameters/ To see it, grep the control file, or inspect /proc/cmdline.
For CONFIG_DYNAMIC_DEBUG kernels, any settings given at boot-time (or enabled by -DDEBUG flag during compilation) can be disabled later via the sysfs interface if the debug messages are no longer needed:
echo "module module_name -p" > <debugfs>/dynamic_debug/control
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140416/77e19fd9/attachment-0001.bin
Martin,
Are you sure that /var/log/messages trap DEBUG messages ? (see /etc/rsylog.conf or something, it depends on your linux distro) Default on Fedora is to skip debug messages. But your log output is in the ring buffer (you can check it widt command dmesg)
I guess that your problem is not a problem but a syslog feature :)
http://www.rsyslog.com/doc/rsyslog_conf_filter.html
Quoted 176 lines · Martin Kepplinger
Am 16.04.2014 13:43 schrieb Denis Pithon:
Quoted 12 lines
Martin,
I'm not sure did you enable DDEBUG when compiling your module ?
pr_debug()macro is discarded if you omit DEBUG in compile timeA sample
Makefilewhich enablepr_debug():obj-m += my_modue.o
KDIR ?=
/lib/modules/uname -r/build
CFLAGS_my_module.o := -DDEBUGQuoted 8 lines
all:
make -C $(KDIR) M=$(PWD) modulesclean:
make -C $(KDIR) M=$(PWD) cleanLet me know ...
regardsThanks,
I did not, but now added -DDEBUG. The exact line is:
CFLAGS_my_module.o := -DDEBUG
when "my_module.o" is my object file. Did I get that right?That doesn't change anything unfortunately. I can not read
pr_debug()unless I
explicitely activate it in/sys/kernel/debug/dynamic_debug/control*after* insmod.I'd like to just read all
pr_debug()messages likepr_info().thanks for your time!
Quoted 130 lines
Quoted 119 lines · Martin Kepplinger
Am 16.04.2014 11:58 schrieb Arun KS:
Quoted 55 lines
Hi Martin,
Quoted 40 lines · Martin Kepplinger
Am 2014-04-16 11:00, schrieb Arun KS:
Quoted 8 lines
Hi Martin,
Quoted 4 lines · Martin Kepplinger
I'm on Debian here and I don't really get
pr_debugand printk(KERN_DEBUG
...). Let's stick topr_debug.Quoted 7 lines
Quoted 3 lines
I have
DYNAMIC_DEBUGenabled and
root at laptop:/proc/sys/kernel# cat/proc/sys/kernel/printk
7 7 1 7This shows the console log level.
This file controls the traffic to console. But all the log messages
will be present in logbuf.How do I view debug messages from logbuf?
Quoted 13 lines
Quoted 13 lines
I write a module with pr_debug's. I load the module and I *don't* see
anything in/var/log/messages(or anywhere in/var/log/*). Adding
#define DEBUG doesn't help.
/sys/kernel/debug/dynamic_debug/controlhas thepr_debugentries I
use
in my loaded module.Quoted 7 lines
Quoted 3 lines
In short: How do I see debug log messages? Using
pr_info()works as
expected. What am I missing? Do I need to edit myMakefile?Did you enable dynamic printing for your file?
Below command enables dynamic printing for file
sdhci.c. echo 'filesdhci.c+p' >/sys/kernel/debug/dynamic_debug/controlQuoted 6 lines
well. I tried that. The thing is, the
pr_debug()symbols are in "control" only after "insmodmy_module". Then I can echo -n 'filemy_mobule.c+p' > control
But mypr_debug()messages get printed directly after insmod, basically
in mymodule_initfunction. Enabling my file doesn't outputanything in
Quoted 1 line
/var/log/*So now you know why your
pr_debugis absent in logbuf.Quoted 8 lines
You can make your module as a built in and use bootargs.
eg:
dyndbg="fileyour_filename.c+p"Thanks,
ArunSo it's *not* possible at all to get
pr_debug()messages just likepr_info()messages?
Of what I've read, I assumedpr_debug()is just loglevel 7.thanks for your help!
Quoted 42 lines
Quoted 30 lines
Quoted 21 lines
Thanks,
ArunQuoted 9 lines
thanks!
martin--
Martin Kepplinger
e-mail martink AT posteo DOT at
chat (XMPP) martink AT jabber DOT atQuoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]
[1]Quoted 7 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]
[1]Quoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]
[1]Links:
------
[1] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
[1]Quoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 4 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies [1]Quoted 8 lines
Links:
------
[1] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Quoted 5 lines
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140416/d4f43dbb/attachment.html