login
Header Space

 
 

Linux: kgdb In The 2.6 Kernel

February 5, 2004 - 11:56pm
Submitted by Jeremy on February 5, 2004 - 11:56pm.
Linux

It was recently pointed out that the stock 2.6.2 kernel contains in-kernel support for kgdb for some architectures, but not i386. 2.6 maintainer Andrew Morton replied, "lots of architectures have had in-kernel kgdb support for a long time. Just none of the three which I use :(" As to getting kgdb for i386 into the kernel, he explained some reluctance:

"I wouldn't support inclusion of i386 kgdb until it has had a lot of cleanup, possible de-featuritisification and some thought has been applied to splitting it into arch and generic bits. It's quite a lot of work."

It was quickly pointed out that Amit Kale has done much of this work with his version of kgdb, available here. Andrew replied, "Look, there's a lot of interest in this and I of course am fully supportive. If someone could send me Amit's patchset when they think I should test it, I could then talk about it more usefully." Read on for much of the lkml thread, including specifics reasons why and why not to include kgdb in the stock 2.6 kernel.


From: Pavel Machek [email blocked]
To: Andrew Morton [email blocked], kernel list
Subject: kgdb support in vanilla 2.6.2
Date: Thu, 5 Feb 2004 00:01:33 +0100

Hi!

It seems that some kgdb support is in 2.6.2-linus:

+++ b/Documentation/sh/kgdb.txt Tue Feb  3 19:45:43 2004
@@ -0,0 +1,179 @@
+
+This file describes the configuration and behavior of KGDB for the SH
+kernel. Based on a description from Henry Bell <henry.bell@st.com>, it
+has been modified to account for quirks in the current implementation.
+

That's great, can we get i386 kgdb, too? Or at least amd64 kgdb
;-). [Or was it a mistake? It seems unlikely that kgdb could enter
Linus tree without major flamewar...]

								Pavel 
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]


From: Andrew Morton [email blocked] Subject: Re: kgdb support in vanilla 2.6.2 Date: Wed, 4 Feb 2004 15:21:37 -0800 Pavel Machek [email blocked] wrote: > > It seems that some kgdb support is in 2.6.2-linus: Lots of architectures have had in-kernel kgdb support for a long time. Just none of the three which I use :( I wouldn't support inclusion of i386 kgdb until it has had a lot of cleanup, possible de-featuritisification and some thought has been applied to splitting it into arch and generic bits. It's quite a lot of work.
From: Pavel Machek [email blocked] Subject: Re: kgdb support in vanilla 2.6.2 Date: Thu, 5 Feb 2004 00:24:47 +0100 Hi! > > It seems that some kgdb support is in 2.6.2-linus: > > Lots of architectures have had in-kernel kgdb support for a long time. > Just none of the three which I use :( > > I wouldn't support inclusion of i386 kgdb until it has had a lot of > cleanup, possible de-featuritisification and some thought has been applied > to splitting it into arch and generic bits. It's quite a lot of work. What about Amit's kgdb? It's a *lot* cleaner. It does not have all the features (kgdb-eth is not yet ready for prime time). Would you accept that? Oh and it is already split into arch-dependend and arch-independend parts, plus it has cleanly separated i/o methods... Pavel -- When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]
From: Andrew Morton [email blocked] Subject: Re: kgdb support in vanilla 2.6.2 Date: Wed, 4 Feb 2004 15:45:48 -0800 Pavel Machek [email blocked] wrote: > > > > It seems that some kgdb support is in 2.6.2-linus: > > > > Lots of architectures have had in-kernel kgdb support for a long time. > > Just none of the three which I use :( > > > > I wouldn't support inclusion of i386 kgdb until it has had a lot of > > cleanup, possible de-featuritisification and some thought has been applied > > to splitting it into arch and generic bits. It's quite a lot of work. > > What about Amit's kgdb? > > It's a *lot* cleaner. It does not have all the features (kgdb-eth is > not yet ready for prime time). Would you accept that? > > Oh and it is already split into arch-dependend and arch-independend > parts, plus it has cleanly separated i/o methods... That all sounds positive. I was waiting until that effort settles down a bit before taking it for a ride. I have a bad habit of finding bugs in the gdb stub for some reason.
From: Tom Rini [email blocked] Subject: Re: kgdb support in vanilla 2.6.2 Date: Wed, 4 Feb 2004 16:55:09 -0700 On Thu, Feb 05, 2004 at 12:24:47AM +0100, Pavel Machek wrote: > Hi! > > > > It seems that some kgdb support is in 2.6.2-linus: > > > > Lots of architectures have had in-kernel kgdb support for a long time. > > Just none of the three which I use :( > > > > I wouldn't support inclusion of i386 kgdb until it has had a lot of > > cleanup, possible de-featuritisification and some thought has been applied > > to splitting it into arch and generic bits. It's quite a lot of work. > > What about Amit's kgdb? > > It's a *lot* cleaner. It does not have all the features (kgdb-eth is > not yet ready for prime time). Would you accept that? > > Oh and it is already split into arch-dependend and arch-independend > parts, plus it has cleanly separated i/o methods... .. and it's supported on i386, x86_64 and PPC32 right now. Andrew, what features of George's version don't you like? Right now I'm working on moving the kgdb-eth driver that uses netpoll over into Amit's version, and thinking of a cleaner away to allow for both early debugging and multiple drivers (eth or serial A or serial B). -- Tom Rini http://gate.crashing.org/~trini/
From: Andrew Morton [email blocked] Subject: Re: kgdb support in vanilla 2.6.2 Date: Wed, 4 Feb 2004 16:16:26 -0800 Tom Rini [email blocked] wrote: > > Andrew, what features of George's version don't you like? This is bad: akpm:/usr/src/25> grep '^+#ifdef' patches/kgdb-ga.patch | wc -l 83 and the fact that it touches 36 different files. Any time I've had to do any maintenance work against that stub I get lost in a twisty maze and just whine at George about it. It's just all over the place. Yes, this is partly the nature of the beast, but I don't see that a ton of effort has been put into reducing the straggliness. > Right now > I'm working on moving the kgdb-eth driver that uses netpoll over > into Amit's version, and thinking of a cleaner away to allow for both > early debugging and multiple drivers (eth or serial A or serial B). Sounds good. Look, there's a lot of interest in this and I of course am fully supportive. If someone could send me Amit's patchset when they think I should test it, I could then talk about it more usefully.
From: Tom Rini [email blocked] Subject: Re: kgdb support in vanilla 2.6.2 Date: Wed, 4 Feb 2004 17:23:28 -0700 On Wed, Feb 04, 2004 at 04:16:26PM -0800, Andrew Morton wrote: > Tom Rini [email blocked] wrote: > > > > Andrew, what features of George's version don't you like? > > This is bad: > > akpm:/usr/src/25> grep '^+#ifdef' patches/kgdb-ga.patch | wc -l > 83 > > and the fact that it touches 36 different files. > > Any time I've had to do any maintenance work against that stub I get lost > in a twisty maze and just whine at George about it. It's just all over the > place. Yes, this is partly the nature of the beast, but I don't see that a > ton of effort has been put into reducing the straggliness. > > > Right now > > I'm working on moving the kgdb-eth driver that uses netpoll over > > into Amit's version, and thinking of a cleaner away to allow for both > > early debugging and multiple drivers (eth or serial A or serial B). > > Sounds good. > > Look, there's a lot of interest in this and I of course am fully > supportive. If someone could send me Amit's patchset when they think I > should test it, I could then talk about it more usefully. Alright. I hope to soon have netpoll'ed kgdb-over-ethernet happy. From there, I'll send you a patch that's Amit's work + cleanups / fixes, and better PPC support. Then we can see which features are in George's version become a must-have. -- Tom Rini http://gate.crashing.org/~trini/
From: Andrew Morton [email blocked] Subject: Re: kgdb support in vanilla 2.6.2 Date: Wed, 4 Feb 2004 15:54:52 -0800 "La Monte H.P. Yarroll" [email blocked] wrote: > > Andrew Morton wrote: > > >Pavel Machek [email blocked] wrote: > > > > > >>It seems that some kgdb support is in 2.6.2-linus: > >> > >> > > > >Lots of architectures have had in-kernel kgdb support for a long time. > >Just none of the three which I use :( > > > >I wouldn't support inclusion of i386 kgdb until it has had a lot of > >cleanup, possible de-featuritisification and some thought has been applied > >to splitting it into arch and generic bits. It's quite a lot of work. > > > > > > Amit has started at least the third activity--he has split much of kgdb > into arch and generic bits. Yes. > Could you elaborate a little on the first two? > > What major kinds of cleanup are we talking about? Style issues? Coding style compliance, reduction of ifdefs, etc. Reduction of patch footprint. There are a few features in the patch in -mm which I am not aware of anyone having used. > What features (or classes of features) do you find excessive? Would > it be sufficient to add a few config items to control subfeatures > of kgdb? > People have added timestamping infrastructure, stack overflow testing and inbuilt assertion frameworks to various gdb stubs at various times. We need to take a look at such things and really convice ourselves that they're worthwhile. Personally, I'd only be interested in the basic stub. I need to take a look at Amit's current patch - it sounds good.
From: Pavel Machek [email blocked] Subject: Re: kgdb support in vanilla 2.6.2 Date: Thu, 5 Feb 2004 02:19:03 +0100 Hi! > > Could you elaborate a little on the first two? > > > > What major kinds of cleanup are we talking about? Style issues? > > Coding style compliance, reduction of ifdefs, etc. Reduction of patch > footprint. There are a few features in the patch in -mm which I am not > aware of anyone having used. > > > What features (or classes of features) do you find excessive? Would > > it be sufficient to add a few config items to control subfeatures > > of kgdb? > > > > People have added timestamping infrastructure, stack overflow testing and > inbuilt assertion frameworks to various gdb stubs at various times. We > need to take a look at such things and really convice ourselves that > they're worthwhile. Personally, I'd only be interested in the basic stub. > > I need to take a look at Amit's current patch - it sounds good. Amit's version does not contain neither timestamping, nor assertions, nor overflows. It has config option that allows it to hook into scheduling (CONFIG_KGDB_THREAD) that wraps schedules() with some code. Without that, patch is not intrusive at all. It would look like (untested, but you should get the idea): [I combined i386, core and serial patch; that's minimum usefull configuration, and killed code inside CONFIG_KGDB_THREAD, as its a little intrusive. It does not look bad at all.] Pavel [patch] -- When do you have a heart between your knees? [Johanka's followup: and *two* hearts?]



Related Links:

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <b> <quote> <pre> <hr> <br> <p> <img> <blockquote> <font> <tt> <table> <tr> <i>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

speck-geostationary