Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-06-2006, 01:31 PM   #1
Registered: Dec 2005
Posts: 83

Rep: Reputation: 15
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
Old 04-06-2006, 04:43 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
1. Did you specify a log level in your "printk()"? EXAMPLE:
printk(KERN_DEBUG "*** This is a debug message only. ***\n");
2. Did you try
3. You can also change printk behavior dynamically, using /proc/sys/kernel/printk:

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

Last edited by paulsm4; 04-06-2006 at 04:46 PM.
Old 04-07-2006, 10:44 AM   #3
Registered: Dec 2005
Posts: 83

Original Poster
Rep: Reputation: 15
Thanks for your help


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
printk not working skie_knite007 Programming 1 12-31-2005 01:26 PM
Using printk arunachalam Linux - Software 1 10-10-2005 03:07 PM
Regarding printk eshwar_ind Programming 0 11-23-2004 06:17 AM
printk: message ernobe Debian 4 11-20-2004 11:50 AM
printk or /proc unosoft Linux - Software 0 10-22-2003 04:05 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration