2002-03-21 22:16:23

by Hari Gadi

[permalink] [raw]
Subject: module (kernel) debugging

Hi,
I am new to kernel level development. What are the best ways to debug runtime kernel (module).
Are there any third party tools for debugging the kernel.

thanks,
Hari.


2002-03-21 22:42:44

by Alan

[permalink] [raw]
Subject: Re: module (kernel) debugging

> I am new to kernel level development. What are the best ways to debug runtime
> kernel (module).

Your brain 8)

> Are there any third party tools for debugging the kernel.

Several

kgdb - debug the kernel with gdb from another PC
kdb - patch for in kernel debugger
UML - user mode linux (good for fs not so good for driver
work)

2002-03-21 23:15:33

by Jeff V. Merkey

[permalink] [raw]
Subject: Re: module (kernel) debugging


One more:

MDB - source level kernel debugger.

:-)

Jeff

On Thu, Mar 21, 2002 at 10:58:26PM +0000, Alan Cox wrote:
> > I am new to kernel level development. What are the best ways to debug runtime
> > kernel (module).
>
> Your brain 8)
>
> > Are there any third party tools for debugging the kernel.
>
> Several
>
> kgdb - debug the kernel with gdb from another PC
> kdb - patch for in kernel debugger
> UML - user mode linux (good for fs not so good for driver
> work)
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2002-03-21 23:30:37

by Christoph Hellwig

[permalink] [raw]
Subject: Re: module (kernel) debugging

On Thu, Mar 21, 2002 at 04:30:15PM -0700, Jeff V. Merkey wrote:
>
> One more:
>
> MDB - source level kernel debugger.

Where?

2002-03-21 23:57:39

by Olaf Dietsche

[permalink] [raw]
Subject: Re: module (kernel) debugging

Alan Cox <[email protected]> writes:

>> I am new to kernel level development. What are the best ways to debug runtime
>> kernel (module).
>
> Your brain 8)

I can confirm this :-).

>> Are there any third party tools for debugging the kernel.

A _first_ party tool, which comes to my mind is:
printk(KERN_DEBUG "whatever\n");
The advantage with printk() is, others can test and debug your module
as well and report results to you.

Regards, Olaf.

2002-03-22 00:08:59

by William Lee Irwin III

[permalink] [raw]
Subject: Re: module (kernel) debugging

On Thu, Mar 21, 2002 at 05:15:48PM -0500, Hari Gadi wrote:
> Hi,
> I am new to kernel level development. What are the best ways to debug
> runtime kernel (module). Are there any third party tools for debugging
> the kernel.


http://www.arium.com
http://oss.sgi.com/projects/kdb
http://oss.sgi.com/projects/kgdb
http://lkcd.sourceforge.net
http://bochs.sourceforge.net

... and other simulators with debugging support.


Cheers,
Bill

2002-03-22 00:18:10

by Jeff V. Merkey

[permalink] [raw]
Subject: Re: module (kernel) debugging

On Thu, Mar 21, 2002 at 11:29:55PM +0000, Christoph Hellwig wrote:
> On Thu, Mar 21, 2002 at 04:30:15PM -0700, Jeff V. Merkey wrote:
> >
> > One more:
> >
> > MDB - source level kernel debugger.
>
> Where?


http://www.kdebug.com. They are still setting up the website and docs. I
completed the debugger a few weeks ago. I have been working on
it for several months now. If you want a copy to play
with, I can send after I ask permission. I do not own it and was
hired to write it as a work for hire, so it's not open source, it's
a commercial product for Linux.

:-)

Jeff

2002-03-22 00:18:30

by Jeff V. Merkey

[permalink] [raw]
Subject: Re: module (kernel) debugging

On Thu, Mar 21, 2002 at 11:29:55PM +0000, Christoph Hellwig wrote:
> On Thu, Mar 21, 2002 at 04:30:15PM -0700, Jeff V. Merkey wrote:
> >
> > One more:
> >
> > MDB - source level kernel debugger.
>
> Where?


http://www.kdebug.com. They are still setting up the website and docs. I
completed the debugger a few weeks ago. I have been working on
it for several months now. If you want a copy to play
with, I can send after I ask permission. I do not own it and was
hired to write it as a work for hire, so it's not open source, it's
a commercial product for Linux.

:-)

Jeff

2002-03-22 00:26:03

by Jeff V. Merkey

[permalink] [raw]
Subject: Re: module (kernel) debugging

On Thu, Mar 21, 2002 at 11:29:55PM +0000, Christoph Hellwig wrote:
> On Thu, Mar 21, 2002 at 04:30:15PM -0700, Jeff V. Merkey wrote:
> >
> > One more:
> >
> > MDB - source level kernel debugger.
>
> Where?


http://www.kdebug.com. They are still putting up the website and docs,
but it should go up soon. It was written as a work for hire. I do
not own it, but I did write it. I was hired to write it and
have been working on it for several months. It's commercial
quality kernel debugger for Linux.

I will ask them when they will have the site up. From what I
understand, they will be distributing the base version from
the website at no charge, and charging for the SLD extensions.

:-)

Jeff

2002-03-22 01:27:23

by Andi Kleen

[permalink] [raw]
Subject: Re: module (kernel) debugging

Alan Cox <[email protected]> writes:

>
> kgdb - debug the kernel with gdb from another PC
> kdb - patch for in kernel debugger
> UML - user mode linux (good for fs not so good for driver
> work)
pice - Private Ice. Source level debugger for modules,
doesn't need a kernel patch and works with a single
machine. 2.2/UP only at the
moment, but can be ported to 2.4. Loosely similar to
Softice on Windows.

-Andi

2002-03-22 06:39:13

by Amit S. Kale

[permalink] [raw]
Subject: Re: module (kernel) debugging

William Lee Irwin III wrote:
>
> On Thu, Mar 21, 2002 at 05:15:48PM -0500, Hari Gadi wrote:
> > Hi,
> > I am new to kernel level development. What are the best ways to debug
> > runtime kernel (module). Are there any third party tools for debugging
> > the kernel.
>
> http://www.arium.com
> http://oss.sgi.com/projects/kdb
> http://oss.sgi.com/projects/kgdb

SGI's kgdb is for 2.2 kernels only.
kgdb for 2.4 kernels resides at http://kgdb.sourceforge.net/
You'll find there scripts for debugging modules with kgdb.

> http://lkcd.sourceforge.net
> http://bochs.sourceforge.net
>
> ... and other simulators with debugging support.
>
> Cheers,
> Bill
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
Amit Kale
Veritas Software India ( http://www.veritasindia.com/ )

2002-03-22 06:58:48

by Andrew Morton

[permalink] [raw]
Subject: Re: module (kernel) debugging

"Amit S. Kale" wrote:
>
> William Lee Irwin III wrote:
> >
> > On Thu, Mar 21, 2002 at 05:15:48PM -0500, Hari Gadi wrote:
> > > Hi,
> > > I am new to kernel level development. What are the best ways to debug
> > > runtime kernel (module). Are there any third party tools for debugging
> > > the kernel.
> >
> > http://www.arium.com
> > http://oss.sgi.com/projects/kdb
> > http://oss.sgi.com/projects/kgdb
>
> SGI's kgdb is for 2.2 kernels only.
> kgdb for 2.4 kernels resides at http://kgdb.sourceforge.net/
> You'll find there scripts for debugging modules with kgdb.
>

I have 2.5 kgdb stub patches too. Various versions can be discovered
by poking around in http://www.zip.com.au/~akpm/linux/patches/

The version I use is a bit thinner than Amit's - I took out the
assertion checks from various places because they cause patching pain.
The assertion mechanism is still there, but the *uses* of it I took
out.

Of course, I may not be feature- or bugfix-current against Amit's
version.

-