Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

Where are kernel messages?

I am trying to add some lines in the kernel's source code, so that when that line is hit, a message will be generated for me to debug. Normally I would do it right away by adding an fprintf function in the source, and wait until that code is processed.

But for the kernel, the issue is different. The standard C libraries are not there, even when I add a library, it generates an error. So I cannot compile the kernel including the standard c libraries for my purpose.

However; there is a function such as this;

printk(KERN_DEBUG "any string"))

I can use this function right away but the problem is that, the system supresses some messages from reaching the destination (/dev/console);

This is the log;

Aug 19:02:17:14 linux kernel: NET: 19 messages supressed

Indeed this was put there to reduce the number of messages to be seen on the screen, but it would also disable the messages I deliberately put there. Now any ideas about what I can do (perhaps another means to send messages from kernel - or disabling that surpassing problem ?)

0
Xephyr
Asked:
Xephyr
1 Solution
 
MysidiaCommented:
They are often duplicates of the same message that are being suppressed.
So instead of printing it 19 times it prints it once then says suppressed

I think klogd may be inhibiting most of the messages from appearing on console though:
do a  ps axwwwu |grep klogd

Is   -c 3   in the command line?    It may be by default, to suppress messages less severe
than KERN_ERR from going to the console

(Make sure -n isn't in the command line before proceeding with just killing klogd.. if it is, you may need to update your
init configuration and reboot)

you could try killing and restarting it with
klogd -c 7
 instead

Consider updating  /etc/syslog.conf   and logging your debug messages to a file of your choice instead

[The best way to deal with kernel debug messages is usually to have syslogd log them to a special file...
flooding the console with debug messages is not fun.]


0
 
XephyrAuthor Commented:
Very well then but I have an even more complicated question I will post as a new thread here...
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now