* Re: [PATCH 12/14] FRV: Generate more useful debug info [not found] ` <200411011930.iA1JUMgs023243@warthog.cambridge.redhat.com.suse.lists.linux.kernel> @ 2004-11-03 5:14 ` Andi Kleen 2004-11-03 21:05 ` Chris Wedgwood 0 siblings, 1 reply; 14+ messages in thread From: Andi Kleen @ 2004-11-03 5:14 UTC (permalink / raw) To: dhowells; +Cc: torvalds, akpm, davidm, linux-kernel dhowells@redhat.com writes: > diff -uNr /warthog/kernels/linux-2.6.10-rc1-bk10/Makefile linux-2.6.10-rc1-bk10-frv/Makefile > --- /warthog/kernels/linux-2.6.10-rc1-bk10/Makefile 2004-11-01 11:45:20.000000000 +0000 > +++ linux-2.6.10-rc1-bk10-frv/Makefile 2004-11-01 11:48:36.397037723 +0000 > @@ -497,11 +497,18 @@ > # Defaults vmlinux but it is usually overriden in the arch makefile > all: vmlinux > > + > +ifdef CONFIG_DEBUG_INFO > +CFLAGS += -g -O1 Please don't do that. At least on i386/x86-64 we want the same code with debug info as without. Otherwise how would you debug a problem that only shows up at -O2. -Andi P.S.: And it's quite unfriendly to put subscriber post only mailing lists into cc of linux kernel threads. Dropped. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-03 5:14 ` [PATCH 12/14] FRV: Generate more useful debug info Andi Kleen @ 2004-11-03 21:05 ` Chris Wedgwood 0 siblings, 0 replies; 14+ messages in thread From: Chris Wedgwood @ 2004-11-03 21:05 UTC (permalink / raw) To: Andi Kleen; +Cc: dhowells, torvalds, akpm, davidm, linux-kernel On Wed, Nov 03, 2004 at 06:14:41AM +0100, Andi Kleen wrote: > Please don't do that. At least on i386/x86-64 we want the same > code with debug info as without. Otherwise how would you debug > a problem that only shows up at -O2. this is true for all architectures really (unless there is a platform where gcc is perfect and completely bug free) ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <76b4a884-2c3c-11d9-91a1-0002b3163499@redhat.com>]
* [PATCH 12/14] FRV: Generate more useful debug info [not found] <76b4a884-2c3c-11d9-91a1-0002b3163499@redhat.com> @ 2004-11-01 19:30 ` dhowells 2004-11-02 0:29 ` Andrew Morton 2004-11-02 11:21 ` David Howells 0 siblings, 2 replies; 14+ messages in thread From: dhowells @ 2004-11-01 19:30 UTC (permalink / raw) To: torvalds, akpm, davidm; +Cc: linux-kernel, uclinux-dev The attached patch permits the generation of more useful debugging information by reducing the optimisation level and by telling the assembler to produce debug info too. Signed-Off-By: dhowells@redhat.com --- diffstat frv-debuginfo-2610rc1bk10.diff Makefile | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff -uNr /warthog/kernels/linux-2.6.10-rc1-bk10/Makefile linux-2.6.10-rc1-bk10-frv/Makefile --- /warthog/kernels/linux-2.6.10-rc1-bk10/Makefile 2004-11-01 11:45:20.000000000 +0000 +++ linux-2.6.10-rc1-bk10-frv/Makefile 2004-11-01 11:48:36.397037723 +0000 @@ -497,11 +497,18 @@ # Defaults vmlinux but it is usually overriden in the arch makefile all: vmlinux + +ifdef CONFIG_DEBUG_INFO +CFLAGS += -g -O1 +AFLAGS += -Wa,--gdwarf2 +ASFLAGS += -Wa,--gdwarf2 +else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE CFLAGS += -Os else CFLAGS += -O2 endif +endif #Add align options if CONFIG_CC_* is not equal to 0 add-align = $(if $(filter-out 0,$($(1))),$(cc-option-align)$(2)=$($(1))) @@ -516,10 +523,6 @@ CFLAGS += -fomit-frame-pointer endif -ifdef CONFIG_DEBUG_INFO -CFLAGS += -g -endif - include $(srctree)/arch/$(ARCH)/Makefile # warn about C99 declaration after statement ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-01 19:30 ` dhowells @ 2004-11-02 0:29 ` Andrew Morton 2004-11-02 11:21 ` David Howells 1 sibling, 0 replies; 14+ messages in thread From: Andrew Morton @ 2004-11-02 0:29 UTC (permalink / raw) To: dhowells; +Cc: torvalds, davidm, linux-kernel, uclinux-dev dhowells@redhat.com wrote: > > The attached patch permits the generation of more useful debugging information > by reducing the optimisation level and by telling the assembler to produce > debug info too. Generates rejects against Sam's tree and appears to be unrelated to FRV, yes? I'd prefer that this be worked through Sam's tree as a separate enhancement please. +ifdef CONFIG_DEBUG_INFO +CFLAGS += -g -O1 +AFLAGS += -Wa,--gdwarf2 +ASFLAGS += -Wa,--gdwarf2 +else Are you sure that all architectures want this? And that their toolchains will continue to work correctly? And that it doesn't break older gcc's and that kgdb will continue to work correctly, etc? I'm not... ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-01 19:30 ` dhowells 2004-11-02 0:29 ` Andrew Morton @ 2004-11-02 11:21 ` David Howells 2004-11-03 1:48 ` Linus Torvalds ` (2 more replies) 1 sibling, 3 replies; 14+ messages in thread From: David Howells @ 2004-11-02 11:21 UTC (permalink / raw) To: Andrew Morton; +Cc: torvalds, davidm, linux-kernel, uclinux-dev > Generates rejects against Sam's tree and appears to be unrelated to FRV, > yes? I know not Sam's tree. It's a generic thing. "gcc -g" does not cause compiled .S files to include debugging information, and -O1 optimised code is more debuggable than -O2 optimised code. > Are you sure that all architectures want this? And that their toolchains > will continue to work correctly? And that it doesn't break older gcc's and > that kgdb will continue to work correctly, etc? -O1: Dunno; if they don't they're buggy, and if they don't they're buggy. -Wa,--gdwarf2: No, no and no. I can move the -Wa flag back into the frv arch if you insist, but moving the -O1 flag there is more tricky, since it'd then be overridden in master Makefile. David ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-02 11:21 ` David Howells @ 2004-11-03 1:48 ` Linus Torvalds 2004-11-03 1:52 ` Linus Torvalds 2004-11-03 13:38 ` David Howells 2004-11-12 14:57 ` Daniel Jacobowitz 2004-11-12 15:15 ` David Howells 2 siblings, 2 replies; 14+ messages in thread From: Linus Torvalds @ 2004-11-03 1:48 UTC (permalink / raw) To: David Howells; +Cc: Andrew Morton, davidm, linux-kernel, uclinux-dev On Tue, 2 Nov 2004, David Howells wrote: > > -O1: Dunno; if they don't they're buggy, and if they don't they're buggy. No. It used to be that inlining was only done with -O2 if I remember correctly. The kernel _needed_ to be compiled with -O2. That may not be true today, but what is true is that -O1 is not a light thing to just do. Linus ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-03 1:48 ` Linus Torvalds @ 2004-11-03 1:52 ` Linus Torvalds 2004-11-03 20:40 ` Florian Weimer 2004-11-03 13:38 ` David Howells 1 sibling, 1 reply; 14+ messages in thread From: Linus Torvalds @ 2004-11-03 1:52 UTC (permalink / raw) To: David Howells; +Cc: Andrew Morton, davidm, linux-kernel, uclinux-dev On Tue, 2 Nov 2004, Linus Torvalds wrote: > > That may not be true today, but what is true is that -O1 is not a light > thing to just do. And btw, in some cases the inlining used to be a correcness issue, so no, just making it be "static inline" doesn't necessarily fix the basic issue. Again, whether that is necessarily true today is not something I'm ready to guarantee one way or the other, so this is just an observation that things can be a lot more subtle than you seem to assume. Linus ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-03 1:52 ` Linus Torvalds @ 2004-11-03 20:40 ` Florian Weimer 2004-11-03 20:42 ` Linus Torvalds 0 siblings, 1 reply; 14+ messages in thread From: Florian Weimer @ 2004-11-03 20:40 UTC (permalink / raw) To: Linus Torvalds Cc: David Howells, Andrew Morton, davidm, linux-kernel, uclinux-dev * Linus Torvalds: >> That may not be true today, but what is true is that -O1 is not a light >> thing to just do. > > And btw, in some cases the inlining used to be a correcness issue, so no, > just making it be "static inline" doesn't necessarily fix the basic issue. But the always_inline attribute hopefully does. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-03 20:40 ` Florian Weimer @ 2004-11-03 20:42 ` Linus Torvalds 0 siblings, 0 replies; 14+ messages in thread From: Linus Torvalds @ 2004-11-03 20:42 UTC (permalink / raw) To: Florian Weimer Cc: David Howells, Andrew Morton, davidm, linux-kernel, uclinux-dev On Wed, 3 Nov 2004, Florian Weimer wrote: > * Linus Torvalds: > > >> That may not be true today, but what is true is that -O1 is not a light > >> thing to just do. > > > > And btw, in some cases the inlining used to be a correcness issue, so no, > > just making it be "static inline" doesn't necessarily fix the basic issue. > > But the always_inline attribute hopefully does. Not with older compilers. Linus ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-03 1:48 ` Linus Torvalds 2004-11-03 1:52 ` Linus Torvalds @ 2004-11-03 13:38 ` David Howells 2004-11-03 15:32 ` Linus Torvalds 1 sibling, 1 reply; 14+ messages in thread From: David Howells @ 2004-11-03 13:38 UTC (permalink / raw) To: Linus Torvalds; +Cc: Andrew Morton, davidm, linux-kernel, uclinux-dev > > That may not be true today, but what is true is that -O1 is not a light > > thing to just do. > > And btw, in some cases the inlining used to be a correcness issue, so no, > just making it be "static inline" doesn't necessarily fix the basic issue. > > Again, whether that is necessarily true today is not something I'm ready > to guarantee one way or the other, so this is just an observation that > things can be a lot more subtle than you seem to assume. I've been able to run a range of 2.4 and 2.6 kernels compiled with -O1 and without any -O flag at all, and with all "extern inline" changed to "static inline". It doesn't seem to be a problem on i386, x86_64, frv (which I'm trying to add) and am33 (which I haven't tried to add yet). When debugging, -O2 makes for a real problem because, amongst other inconvenient things, it enables the explicit parallelisation features that frv cpus support. Would you object to making it possible for the arch to override the optimisation level when debugging? David ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-03 13:38 ` David Howells @ 2004-11-03 15:32 ` Linus Torvalds 0 siblings, 0 replies; 14+ messages in thread From: Linus Torvalds @ 2004-11-03 15:32 UTC (permalink / raw) To: David Howells; +Cc: Andrew Morton, davidm, linux-kernel, uclinux-dev On Wed, 3 Nov 2004, David Howells wrote: > > I've been able to run a range of 2.4 and 2.6 kernels compiled with -O1 and > without any -O flag at all, and with all "extern inline" changed to "static > inline". It doesn't seem to be a problem on i386, x86_64, frv (which I'm > trying to add) and am33 (which I haven't tried to add yet). sparc64 was one of the things that definitely depended on it. Also, early init/main.c depended on the stack not getting clobbered by the initial fork, but that thankfully was cleaned up with the kernel threads interfaces. > Would you object to making it possible for the arch to override the > optimisation level when debugging? Quite frankly, I'd prefer developers to do it by just editing the Makefile, or doing it entirely statically for some architecture. For something like FRV in its current stages it simply doesn't _matter_, but in architectures that get actual real usage, I absolutely hate the idea of having different optimization options and wildly different code. It just results in bugs being harder to reproduce. And for architectures that don't have enough users to matter, arguably you shouldn't then need to have a config option that is visible to the rest of the world. Linus ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-02 11:21 ` David Howells 2004-11-03 1:48 ` Linus Torvalds @ 2004-11-12 14:57 ` Daniel Jacobowitz 2004-11-12 15:15 ` David Howells 2 siblings, 0 replies; 14+ messages in thread From: Daniel Jacobowitz @ 2004-11-12 14:57 UTC (permalink / raw) To: David Howells; +Cc: linux-kernel On Tue, Nov 02, 2004 at 11:21:36AM +0000, David Howells wrote: > > > Generates rejects against Sam's tree and appears to be unrelated to FRV, > > yes? > > I know not Sam's tree. > > It's a generic thing. "gcc -g" does not cause compiled .S files to include > debugging information, and -O1 optimised code is more debuggable than -O2 > optimised code. FYI, "gcc -g" _should_ cause .S files to include assembler debugging information. If it doesn't, that's a bug in your port. *asm_debug: %{gstabs*:--gstabs}%{!gstabs*:%{g*:--gdwarf2}} -- Daniel Jacobowitz ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-02 11:21 ` David Howells 2004-11-03 1:48 ` Linus Torvalds 2004-11-12 14:57 ` Daniel Jacobowitz @ 2004-11-12 15:15 ` David Howells 2004-11-12 15:20 ` Daniel Jacobowitz 2 siblings, 1 reply; 14+ messages in thread From: David Howells @ 2004-11-12 15:15 UTC (permalink / raw) To: Daniel Jacobowitz; +Cc: linux-kernel > FYI, "gcc -g" _should_ cause .S files to include assembler debugging > information. If it doesn't, that's a bug in your port. It appears you may have a point. Running FRV compiler with gcc -g on a .S file does not pass any sort of -g flag to the assembler. It does with the i386 compiler. David ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 12/14] FRV: Generate more useful debug info 2004-11-12 15:15 ` David Howells @ 2004-11-12 15:20 ` Daniel Jacobowitz 0 siblings, 0 replies; 14+ messages in thread From: Daniel Jacobowitz @ 2004-11-12 15:20 UTC (permalink / raw) To: David Howells; +Cc: linux-kernel On Fri, Nov 12, 2004 at 03:15:18PM +0000, David Howells wrote: > > > FYI, "gcc -g" _should_ cause .S files to include assembler debugging > > information. If it doesn't, that's a bug in your port. > > It appears you may have a point. Running FRV compiler with gcc -g on a .S file > does not pass any sort of -g flag to the assembler. It does with the i386 > compiler. You're probably not selecting the right assembler to feature-test at build time. Check these: && defined(HAVE_AS_GDWARF2_DEBUG_FLAG) && defined(HAVE_AS_GSTABS_DEBUG_FLAG) -- Daniel Jacobowitz ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2004-11-12 15:20 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <76b4a884-2c3c-11d9-91a1-0002b3163499@redhat.com.suse.lists.linux.kernel>
[not found] ` <200411011930.iA1JUMgs023243@warthog.cambridge.redhat.com.suse.lists.linux.kernel>
2004-11-03 5:14 ` [PATCH 12/14] FRV: Generate more useful debug info Andi Kleen
2004-11-03 21:05 ` Chris Wedgwood
[not found] <76b4a884-2c3c-11d9-91a1-0002b3163499@redhat.com>
2004-11-01 19:30 ` dhowells
2004-11-02 0:29 ` Andrew Morton
2004-11-02 11:21 ` David Howells
2004-11-03 1:48 ` Linus Torvalds
2004-11-03 1:52 ` Linus Torvalds
2004-11-03 20:40 ` Florian Weimer
2004-11-03 20:42 ` Linus Torvalds
2004-11-03 13:38 ` David Howells
2004-11-03 15:32 ` Linus Torvalds
2004-11-12 14:57 ` Daniel Jacobowitz
2004-11-12 15:15 ` David Howells
2004-11-12 15:20 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®