[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

changing linux kernel code??

Hi,
I am trying to put some debug messages in linux host stack source files, but I am not able to see those changes after rebuilding kernel.

is there anyother way to get this done, how can i add my code??


thanks
-
0
leruj
Asked:
leruj
1 Solution
 
vrihadCommented:
Are you using printf() to print debug messages? If so, kernel can't use this function as it is part of libc. No library based function calls are possible from within the kernel.

Use printk() instead.

-Vrihad
0
 
bryanhCommented:
I think we can assume he isn't using printf(), because the kernel would not have built if he did.

The usual cause of missing printk's is that you aren't looking in the right place for them.

So how about some details:  How are you attempting to issue debug messages, and how are you concluding that you aren't getting them?

I'm also wondering what "linux host stack" source files are.  I'm assuming they're Linux kernel source files.
0
 
lerujAuthor Commented:
I am using printk with KERN_DEBUG priority.
I have to make whole kernel again to see changes and restart with new kernel again, its not suiting me.

I am looking for something that i dont have to make the whole kernel but host sources(/usr/src/linux.../drivers/usb/host), also i dont have to restart my system with new kernel.

thanks,
-krishna


 
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
bryanhCommented:
So the problem has changed from you can't get messages after rebuilding the kernel to you want to get newly added messages without rebuilding the kernel?

I don't know what this USB host stuff is -- my kernel does not have a drivers/usb/host -- but is it a loadable kernel module?  If not, it should be.  If you build this module as an LKM, then you have only to rebuild and reload the LKM and you will see the results of any printk you added.  You don't have to rebuild or restart the rest of the kernel.
0
 
lerujAuthor Commented:
bryanh, can you please look at kernel version 2.5.60? yeah i have it as LKM, but I am not able to build my modules.

Also I need to know whether I have to write my own Rules.make and Makefile to build a seperate module,say ehci-hcd??


Thanks,
-krishna
0
 
bryanhCommented:
Sorry, I don't have convenient access to 2.5 source code.  I haven't worked with it, but I've read a lot.  Building an LKM is quite different from the past, and I've heard it is hard to build one without integrating it into the kernel build system.  (By contrast, in 2.4 it's easy to keep LKM sources in a whole different directory and write all your own make files).

And it seems the question has changed again such that it is now one of not being able to build modules.  But you don't provide any details one could use to answer that question.
0
 
jmcgOwnerCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: bryanh {http:#8062219}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now