LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 10-08-2008, 05:32 AM   #1
awbodbijl
LQ Newbie
 
Registered: Oct 2008
Location: Eindhoven, Netherlands
Distribution: Redhat
Posts: 2

Rep: Reputation: 0
How can I read some kernel variable and print it?


Hi,
Currenlty I am having a problem where a read operation from an SD card simply hangs. Because of the many read operations, simply adding printk statements to the read function will not work, because it will cause timing problems that run out of hand before the actual problem pops up.
So I thought of having some global variable (say read_status), that is changed to specific value at certain steps while executing the read. Now when the program hangs, simply reading this variable will tell me where exactly the program is. But reading this variable has proven to be very difficult. Can anybody help me out?
tx
 
Old 10-09-2008, 10:31 AM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,095
Blog Entries: 2

Rep: Reputation: 111Reputation: 111
Make a small module that has a read only procfs entry. Set the module up such that reads on the procfs entry return the value of the variable in question.
 
Old 10-13-2008, 05:52 AM   #3
awbodbijl
LQ Newbie
 
Registered: Oct 2008
Location: Eindhoven, Netherlands
Distribution: Redhat
Posts: 2

Original Poster
Rep: Reputation: 0
Thumbs up That's just what I needed!

Thanks estabroo for this suggestion!
 
  


Reply


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
Not able to print variable value in crontab entry naren_0101bits Programming 6 12-10-2007 01:04 PM
how to print variable value in Makefile? George2 Programming 12 04-27-2006 06:12 AM
Perl wont print my Variable!!! socceroos Programming 10 03-15-2006 06:04 PM
Getting PHP to print variable value on a webpage tangle Programming 9 02-07-2006 03:39 PM
Print a part of variable/string p0tw0r Linux - Newbie 1 04-07-2005 03:49 PM


All times are GMT -5. The time now is 04:51 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration