Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-25 Thread Andrew Haley
H. Peter Anvin wrote: > On 11/25/2009 08:44 AM, Jakub Jelinek wrote: >> If you compile kernels 90%+ people out there run with -p on i?86/x86_64, >> then certainly coming up with a new gcc switch and new profiling ABI is >> desirable. -p on i?86/x86_64 e.g. forces -fno-omit-frame-pointer, which >>

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-25 Thread H. Peter Anvin
On 11/25/2009 08:44 AM, Jakub Jelinek wrote: > > If you compile kernels 90%+ people out there run with -p on i?86/x86_64, > then certainly coming up with a new gcc switch and new profiling ABI is > desirable. -p on i?86/x86_64 e.g. forces -fno-omit-frame-pointer, which > makes code on these regis

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-25 Thread H. Peter Anvin
On 11/24/2009 09:30 AM, Steven Rostedt wrote: > > For other archs, Linus showed some examples: > > http://lkml.org/lkml/2009/11/19/349 > Yes; the key here is that the ABI-defined entry state is readily mappable onto the state on entry to the __fentry__ function. -hpa -- H. Peter Anvi

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-25 Thread Jakub Jelinek
On Wed, Nov 25, 2009 at 04:44:52PM +0100, Ingo Molnar wrote: > > * Thomas Gleixner wrote: > > > On Tue, 24 Nov 2009, Jakub Jelinek wrote: > > > > > On Tue, Nov 24, 2009 at 03:55:49PM +0100, Thomas Gleixner wrote: > > > > > you should compile your code with -maccumulate-outgoing-args, and > > >

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-25 Thread Ingo Molnar
* Thomas Gleixner wrote: > On Wed, 25 Nov 2009, Ingo Molnar wrote: > > * Thomas Gleixner wrote: > > > > > On Tue, 24 Nov 2009, Jakub Jelinek wrote: > > > > > > > On Tue, Nov 24, 2009 at 03:55:49PM +0100, Thomas Gleixner wrote: > > > > > > you should compile your code with -maccumulate-outgoin

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-25 Thread Thomas Gleixner
On Wed, 25 Nov 2009, Ingo Molnar wrote: > * Thomas Gleixner wrote: > > > On Tue, 24 Nov 2009, Jakub Jelinek wrote: > > > > > On Tue, Nov 24, 2009 at 03:55:49PM +0100, Thomas Gleixner wrote: > > > > > you should compile your code with -maccumulate-outgoing-args, and > > > > > there's > > > > > n

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-25 Thread Ingo Molnar
* Thomas Gleixner wrote: > On Tue, 24 Nov 2009, Jakub Jelinek wrote: > > > On Tue, Nov 24, 2009 at 03:55:49PM +0100, Thomas Gleixner wrote: > > > > you should compile your code with -maccumulate-outgoing-args, and > > > > there's > > > > no need to use -mtune=generic. Is that right? > > > >

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-25 Thread Thomas Gleixner
On Tue, 24 Nov 2009, Jakub Jelinek wrote: > On Tue, Nov 24, 2009 at 03:55:49PM +0100, Thomas Gleixner wrote: > > > you should compile your code with -maccumulate-outgoing-args, and there's > > > no need to use -mtune=generic. Is that right? > > > > Seems to work. What other side effects has that

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread H. Peter Anvin
On 11/24/2009 09:12 AM, Andrew Haley wrote: >> >> If we're changing gcc anyway, then let's add the option of intercepting >> the function at the point where the machine state is well-defined by >> ABI, which is before the function stack frame is set up. > > Hmm. On the x86 I suppose we could just

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Steven Rostedt
On Tue, 2009-11-24 at 17:12 +, Andrew Haley wrote: > H. Peter Anvin wrote: > > If we're changing gcc anyway, then let's add the option of intercepting > > the function at the point where the machine state is well-defined by > > ABI, which is before the function stack frame is set up. > > Hmm.

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Andrew Haley
H. Peter Anvin wrote: > On 11/24/2009 07:46 AM, Andrew Haley wrote: >>> Yes, a lot. The difference is that -maccumulate-outgoing-args allocates >>> space for arguments of the callee with most arguments in the prologue, using >>> subtraction from sp, then to pass arguments uses movl XXX, 4(%esp) et

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Andrew Haley
Ross Ridge wrote: > Andrew Haley writes: >> Alright. So, it is possible in theory for gcc to generate code that >> only uses -maccumulate-outgoing-args when it needs to realign SP. >> And, therefore, we could have a nice option for the kernel: one with >> (mostly) good code density and never gener

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Ross Ridge
Andrew Haley writes: >Alright. So, it is possible in theory for gcc to generate code that >only uses -maccumulate-outgoing-args when it needs to realign SP. >And, therefore, we could have a nice option for the kernel: one with >(mostly) good code density and never generates the bizarre code >seque

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread H. Peter Anvin
On 11/24/2009 07:46 AM, Andrew Haley wrote: >> >> Yes, a lot. The difference is that -maccumulate-outgoing-args allocates >> space for arguments of the callee with most arguments in the prologue, using >> subtraction from sp, then to pass arguments uses movl XXX, 4(%esp) etc. >> and the stack poin

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Andrew Haley
Jakub Jelinek wrote: > On Tue, Nov 24, 2009 at 03:32:20PM +, Andrew Haley wrote: >> Jakub Jelinek wrote: >>> On Tue, Nov 24, 2009 at 03:55:49PM +0100, Thomas Gleixner wrote: > you should compile your code with -maccumulate-outgoing-args, and there's > no need to use -mtune=generic. Is

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Jakub Jelinek
On Tue, Nov 24, 2009 at 03:32:20PM +, Andrew Haley wrote: > Jakub Jelinek wrote: > > On Tue, Nov 24, 2009 at 03:55:49PM +0100, Thomas Gleixner wrote: > >>> you should compile your code with -maccumulate-outgoing-args, and there's > >>> no need to use -mtune=generic. Is that right? > >> Seems t

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Andrew Haley
Jakub Jelinek wrote: > On Tue, Nov 24, 2009 at 03:55:49PM +0100, Thomas Gleixner wrote: >>> you should compile your code with -maccumulate-outgoing-args, and there's >>> no need to use -mtune=generic. Is that right? >> Seems to work. What other side effects has that ? > > Faster code, significant

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Jakub Jelinek
On Tue, Nov 24, 2009 at 03:55:49PM +0100, Thomas Gleixner wrote: > > you should compile your code with -maccumulate-outgoing-args, and there's > > no need to use -mtune=generic. Is that right? > > Seems to work. What other side effects has that ? Faster code, significant increase in code size th

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Thomas Gleixner
On Tue, 24 Nov 2009, Andrew Haley wrote: > H.J. Lu wrote: > > On Sun, Nov 22, 2009 at 9:20 AM, Andrew Haley wrote: > >> H.J. Lu wrote: > >>> On Fri, Nov 20, 2009 at 11:35 AM, Andrew Haley wrote: > Steven Rostedt wrote: > > Ingo, Thomas and Linus, > > > > I know Thomas did a patch

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-24 Thread Andrew Haley
H.J. Lu wrote: > On Sun, Nov 22, 2009 at 9:20 AM, Andrew Haley wrote: >> H.J. Lu wrote: >>> On Fri, Nov 20, 2009 at 11:35 AM, Andrew Haley wrote: Steven Rostedt wrote: > Ingo, Thomas and Linus, > > I know Thomas did a patch to force the -mtune=generic, but just in case > gcc

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-22 Thread H.J. Lu
On Sun, Nov 22, 2009 at 9:20 AM, Andrew Haley wrote: > H.J. Lu wrote: >> On Fri, Nov 20, 2009 at 11:35 AM, Andrew Haley wrote: >>> Steven Rostedt wrote: Ingo, Thomas and Linus, I know Thomas did a patch to force the -mtune=generic, but just in case gcc decides to do something

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-22 Thread Andrew Haley
H.J. Lu wrote: > On Fri, Nov 20, 2009 at 11:35 AM, Andrew Haley wrote: >> Steven Rostedt wrote: >>> Ingo, Thomas and Linus, >>> >>> I know Thomas did a patch to force the -mtune=generic, but just in case >>> gcc decides to do something crazy again, this patch will catch it. >>> >>> Should we try t

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-22 Thread H.J. Lu
On Fri, Nov 20, 2009 at 11:35 AM, Andrew Haley wrote: > Steven Rostedt wrote: >> Ingo, Thomas and Linus, >> >> I know Thomas did a patch to force the -mtune=generic, but just in case >> gcc decides to do something crazy again, this patch will catch it. >> >> Should we try to get this in now? > > I

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-22 Thread Ingo Molnar
* Steven Rostedt wrote: > Ingo, Thomas and Linus, > > I know Thomas did a patch to force the -mtune=generic, but just in > case gcc decides to do something crazy again, this patch will catch > it. > > Should we try to get this in now? Very nice example of defensive coding - i like this. I'v

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-20 Thread H. Peter Anvin
On 11/20/2009 11:46 AM, Steven Rostedt wrote: > > Yes a gcc test suite will help new instances of gcc. But we need to > worry about the instances of gcc that people have on their desktops now. > This test case will catch the discrepancy between gcc and the function > graph tracer. I'm not 100% con

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-20 Thread Steven Rostedt
On Fri, 2009-11-20 at 19:35 +, Andrew Haley wrote: > Steven Rostedt wrote: > > Ingo, Thomas and Linus, > > > > I know Thomas did a patch to force the -mtune=generic, but just in case > > gcc decides to do something crazy again, this patch will catch it. > > > > Should we try to get this in no

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-20 Thread Andrew Haley
Steven Rostedt wrote: > Ingo, Thomas and Linus, > > I know Thomas did a patch to force the -mtune=generic, but just in case > gcc decides to do something crazy again, this patch will catch it. > > Should we try to get this in now? I'm sure this makes sense, but a gcc test case would be even bett

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-20 Thread H. Peter Anvin
On 11/20/2009 09:00 AM, Steven Rostedt wrote: > Ingo, Thomas and Linus, > > I know Thomas did a patch to force the -mtune=generic, but just in case > gcc decides to do something crazy again, this patch will catch it. > > Should we try to get this in now? > Sounds like a very good idea to me.

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-20 Thread Steven Rostedt
Ingo, Thomas and Linus, I know Thomas did a patch to force the -mtune=generic, but just in case gcc decides to do something crazy again, this patch will catch it. Should we try to get this in now? -- Steve On Fri, 2009-11-20 at 00:23 -0500, Steven Rostedt wrote: > commit c7715fb611c69ac4b7f722a

Re: [PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-19 Thread Steven Rostedt
This touches the Makefile scripts. I forgot to CC kbuild and Sam. -- Steve On Fri, 2009-11-20 at 00:23 -0500, Steven Rostedt wrote: > Ingo, > > Not sure if this is too much for this late in the -rc game, but it finds > the gcc bug at build time, and we don't need to disable function graph > trac

[PATCH][GIT PULL][v2.6.32] tracing/x86: Add check to detect GCC messing with mcount prologue

2009-11-19 Thread Steven Rostedt
Ingo, Not sure if this is too much for this late in the -rc game, but it finds the gcc bug at build time, and we don't need to disable function graph tracer for all i386 builds. This is built on my last urgent repo pull request. Please pull the latest tip/tracing/urgent-2 tree, which can be fou