hi all: my questions are below: 1. Can I temporarily let kernel message show in stdout? I google some key word as "console_loglevel" and I found following methods: a. echo 8 > /proc/sys/kernel/printk b. write a simple program which calling "klogctl(8, NULL, level)" Then I purposely connect/disconnect USB, but my console keep quiet. But dmesg shows connect/disconnect messages. 2. what is differences between above a and b methods? Are they not to used to change console_loglevel? 3. is it possible the max level of "console_loglevel" doesn't mean it will show on stdout? -- Thanks for your help
On Mon, Dec 12, 2011 at 21:18, loody <miloody@gmail.com> wrote:
hi all: my questions are below: 1. Can I temporarily let kernel message show in stdout? I google some key word as "console_loglevel" and I found following methods: a. echo 8 > /proc/sys/kernel/printk b. write a simple program which calling "klogctl(8, NULL, level)" Then I purposely connect/disconnect USB, but my console keep quiet. But dmesg shows connect/disconnect messages.
Perhaps this document could explain the basics better than me: http://lxr.linux.no/#linux+v3.1.5/Documentation/sysctl/kernel.txt#L405 Hope that helps... -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On Mon, Dec 12, 2011 at 10:18:20PM +0800, loody wrote:
Then I purposely connect/disconnect USB, but my console keep quiet.
Which "console" are you looking at? It only works with the consoles provided by the kernel (ttyN) on usual desktop distros, and not with xterm-alikes. HTH, Jonathan Neuschäfer
hi: 2011/12/13 Jonathan Neuschäfer <j.neuschaefer@gmx.net>:
On Mon, Dec 12, 2011 at 10:18:20PM +0800, loody wrote:
Then I purposely connect/disconnect USB, but my console keep quiet.
Which "console" are you looking at? It only works with the consoles provided by the kernel (ttyN) on usual desktop distros, and not with xterm-alikes. I use ubuntu 11.04 and I use gnome terminal. so you mean what I saw in gonme terminal may not be the ttyN that enabled by kernel? if that is the root cause, is it possible for me to switch my gonme terminal to ttyN you mentioned?
Appreciate your help,
On Tue, Dec 13, 2011 at 08:57, loody <miloody@gmail.com> wrote:
hi:
2011/12/13 Jonathan Neuschäfer <j.neuschaefer@gmx.net>:
On Mon, Dec 12, 2011 at 10:18:20PM +0800, loody wrote:
Then I purposely connect/disconnect USB, but my console keep quiet.
Which "console" are you looking at? It only works with the consoles provided by the kernel (ttyN) on usual desktop distros, and not with xterm-alikes. I use ubuntu 11.04 and I use gnome terminal. so you mean what I saw in gonme terminal may not be the ttyN that enabled by kernel? if that is the root cause, is it possible for me to switch my gonme terminal to ttyN you mentioned?
Appreciate your help,
Jonathan refer to consoles you usually get when pressing Ctrl-Alt-F1 throught Ctrl-Alt-F6. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
hi all: I can see the message, right now. 2011/12/13 Mulyadi Santosa <mulyadi.santosa@gmail.com>:
On Tue, Dec 13, 2011 at 08:57, loody <miloody@gmail.com> wrote:
hi:
2011/12/13 Jonathan Neuschäfer <j.neuschaefer@gmx.net>:
On Mon, Dec 12, 2011 at 10:18:20PM +0800, loody wrote:
Then I purposely connect/disconnect USB, but my console keep quiet.
Which "console" are you looking at? It only works with the consoles provided by the kernel (ttyN) on usual desktop distros, and not with xterm-alikes. I use ubuntu 11.04 and I use gnome terminal. so you mean what I saw in gonme terminal may not be the ttyN that enabled by kernel? if that is the root cause, is it possible for me to switch my gonme terminal to ttyN you mentioned?
Appreciate your help,
Jonathan refer to consoles you usually get when pressing Ctrl-Alt-F1 throught Ctrl-Alt-F6.
BTW, is there any api I can flush all the messages in kernel buffer ring before when I jump to BUG(), kernel checking MACRO? my problem is: 1. I put more detail messages in the level 8, usually it will shows up if I change console_loglevel or type dmesg. 2. I don't want it to show in normal operation. 3. but I want to see them before my driver jump to BUG() check point. Thanks for your help,
Hi... On Fri, Jun 29, 2012 at 10:05 AM, loody <miloody@gmail.com> wrote:
is it possible to direct kernel log to xterm-alikes console? Thanks for your help in advance,
it depends on your syslog daemon setting. Assuming you're using plain old syslogd, perhaps you need to adjust /etc/syslog.conf to contain: kern.* /dev/console IIRC, desktop environment such KDE (I only check it on KDE 3.5.x) will catch such message which is thrown to console and display it in a pop up. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
participants (3)
-
Jonathan Neuschäfer -
loody -
Mulyadi Santosa