From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5422 invoked by alias); 20 Nov 2009 12:35:27 -0000 Received: (qmail 5412 invoked by uid 22791); 20 Nov 2009 12:35:26 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from hrndva-omtalb.mail.rr.com (HELO hrndva-omtalb.mail.rr.com) (71.74.56.125) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Nov 2009 12:34:22 +0000 Received: from [192.168.23.10] (really [74.67.89.75]) by hrndva-omta04.mail.rr.com with ESMTP id <20091120123420854.KUQO20219@hrndva-omta04.mail.rr.com>; Fri, 20 Nov 2009 12:34:20 +0000 Subject: Re: [PATCH] gcc mcount-nofp was Re: BUG: GCC-4.4.x changes the function frame on some functions From: Steven Rostedt Reply-To: rostedt@goodmis.org To: Andi Kleen Cc: Ingo Molnar , Linus Torvalds , Richard Guenther , Thomas Gleixner , "H. Peter Anvin" , LKML , Andrew Morton , Heiko Carstens , feng.tang@intel.com, Fr??d??ric Weisbecker , Peter Zijlstra , jakub@redhat.com, gcc@gcc.gnu.org In-Reply-To: <87iqd54iz5.fsf_-_@basil.nowhere.org> References: <20091119072040.GA23579@elte.hu> <1258653562.22249.682.camel@gandalf.stny.rr.com> <84fc9c000911191003t244eb864o3d5b355ab5485f@mail.gmail.com> <20091119184716.GA25458@elte.hu> <1258657614.22249.824.camel@gandalf.stny.rr.com> <87iqd54iz5.fsf_-_@basil.nowhere.org> Content-Type: text/plain Date: Fri, 20 Nov 2009 12:35:00 -0000 Message-Id: <1258720459.22249.1018.camel@gandalf.stny.rr.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-11/txt/msg00569.txt.bz2 On Fri, 2009-11-20 at 10:57 +0100, Andi Kleen wrote: > Steven Rostedt writes: > > > > And frame pointers do add a little overhead as well. Too bad the mcount > > ABI wasn't something like this: > > > > > > : > > call mcount > > [...] > > > > This way, the function address for mcount would have been (%esp) and the > > parent address would be 4(%esp). Mcount would work without frame > > pointers and this whole mess would also become moot. > > I did a patch to do this in x86 gcc some time ago. The motivation > was indeed the frame pointer overhead on Atom with tracing. > Yes, I remember you talking about this but I don't remember how far it went. > Unfortunately it also requires glibc changes (I did those too). For > compatibility and catching mistakes the new function was called > __mcount_nofp. Actually, could you change the name? I really hate the "mcount" name, it is legacy and with a new feature, it should be abandoned. Something like "__fentry__" would be nicer. > > I haven't tried it with current gcc and last time I missed the > gcc feature merge window with this. > > But perhaps you find it useful. Of course it would need more > kernel changes to probe for the new option and handle it. > > Here's the old patch. I haven't retested it with a current > gcc version, but I think it still applies at least. > > If there's interest I can polish it up and submit formally. I would definitely be interested, and I would also be willing to test it. Thanks! -- Steve