LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Printk is not printing (https://www.linuxquestions.org/questions/programming-9/printk-is-not-printing-432386/)

allomeen 04-06-2006 01:31 PM

Printk is not printing
 
Hello Everyone,

I have a device and I'm trying to debug it with printk(). The printk() never prints anything to the screen nor the /var/log/messages file. I tried all levels and nothing is showing up. Can anyone help me please?


Thanks in advance,
Alaa G

paulsm4 04-06-2006 04:43 PM

1. Did you specify a log level in your "printk()"? EXAMPLE:
Code:

printk(KERN_DEBUG "*** This is a debug message only. ***\n");
2. Did you try
Quote:

dmesg
3. You can also change printk behavior dynamically, using /proc/sys/kernel/printk:
http://old.lunar-linux.org/?q=node/view/781

Quote:

If you want to change system parameters, all you need to do is write
the new values to the correct file in /proc/sys. If the file contains
an array of values, they will be overwritten in order. Let's look at
the kernel/printk file as an example. printk was first introduced in
kernel version 2.1.32. The four numbers in /proc/sys/kernel/printk
control the ``verbosity'' level of the printk kernel function. The
first number in the array is console_loglevel: kernel messages with
priority less than or equal to the specified value will be printed to
the system console (i.e., the active virtual console, unless you've
changed it). This parameter doesn't affect the operation of klogd,
which receives all the messages in any case. The following commands
show how to change the log level:

# cat kernel/printk
6 4 1 7
# echo 8 > kernel/printk
# cat kernel/printk
8 4 1 7

A level of 8 corresponds to debug messages, which are not printed on
the console by default. The example session shown above changes the
default behaviour so that every message, including the debug ones, are
printed.

allomeen 04-07-2006 10:44 AM

Thanks for your help


All times are GMT -5. The time now is 02:14 PM.