LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-12-2008, 06:52 PM   #1
fanoliv
LQ Newbie
 
Registered: Jun 2006
Posts: 27

Rep: Reputation: 15
Adding debugging printk to kernel


My system occasionally hangs during the kernel boot. So I'm doing some investigation trying to see what's going on. I'm using Fedora 9, and I'm following instructions from http://fedoraproject.org/wiki/Docs/CustomKernel to modify and build a kernel.

Basically I just added some printk statements around the places where the hang happens. The problem is after rebuilding the kernel, I don't see the messages I added come out on the console when I boot it up. (I added 'console=ttyS0,115200' as a kernel parameter in grub.conf).

I have a couple of questions.

1. In the files where I added my printk, there are already some printk there in the format
Code:
printk(KERN_INFO PREFIX "text"\n.);
but I omitted the PREFIX from the printk I added. So I just have
Code:
printk(KERN_INFO "my text"\n.);
But that shouldn't be the reason why my printk is not coming out right?

2. I see in the kernel source that there are a lot of other printk already there, but I don't see those coming out on my serial terminal neither. What do I have to change to get all the printk to come out on the serial? I've already tried adding the line
Code:
"kernel.printk = 7     1      4       7"
to my sysctl.conf file, but that doesn't seem to be making any difference.

I guess my goal is I would like to be able to see all of the kernel messages come out on the serial console so it can help me pinpoint what's the problem when the system hangs. Right now the messages that come out by default are not sufficient. So I'm trying to add my own, but having a problem seeing them. Any help is much appreciated.
 
  


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
printk does not output in the /var/log/messages for kernel compiled with debugging shoily Linux - Kernel 2 06-01-2008 05:08 PM
printk(KERN_DEBUG ...) vs printk(...) Sergei Lavrov Linux - Kernel 2 03-25-2007 04:41 PM
Difference between kernel - debugging and application debugging topworld Linux - Software 2 03-30-2006 12:50 AM
Visual Debugging and Linux Kernel Debugging Igor007 Programming 0 09-30-2005 10:33 AM
linux kernel: printk: 39476 messages suppressed. seanfitz Mandriva 4 04-19-2005 04:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:59 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
Open Source Consulting | Domain Registration