On Fri, Jan 14, 2000 at 05:59:48PM +0530, Ajit, Kumar (IE10) wrote:
> One way you can do this is by writing a kernel module which will get
> the values of the datastructures of the kernel at a particular instance.
> When you run that process the module will take the values of the various
> data structures. But there is a problem with this type because the linux
> kernel runs as a single thread. You cannot have more then one thread running
> inside the kernel simultaneously.
Ever since Linux 2.2.x, which started supporting SMP, Linux kernel had
multiple threads. But there were all serialized with a big lock, effectively
making it single threaded.
This is no longer true in Linux 2.3.x. So if you write a kernel module for
2.3.x, you have to take care of the cases where the code is getting
executed simultaneously on multiple processors.
> Second is that you can make changes in the source code and make the
> kernel log the values of the datastructures in stdout or a file which you
> can use.
You can also use gdb on /proc/kcore or kdb (from SGI) to read values
from kernel memory statically.
For more sophisticated stuff, use a kernel module, that exports values
using ioctls on a pseudo device (/dev/foo) or /proc, as Ajit suggested.
-Arun
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available. Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.