LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 04-06-2006, 01:31 PM   #1
allomeen
Member
 
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
paulsm4
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:
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.

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

Original Poster
Rep: Reputation: 15
Thanks for your help
 
  


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:47 AM.

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