Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752999AbZKTMeR (ORCPT ); Fri, 20 Nov 2009 07:34:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752424AbZKTMeQ (ORCPT ); Fri, 20 Nov 2009 07:34:16 -0500 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.123]:62418 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989AbZKTMeP (ORCPT ); Fri, 20 Nov 2009 07:34:15 -0500 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 Organization: Kihon Technologies Inc. Date: Fri, 20 Nov 2009 07:34:19 -0500 Message-Id: <1258720459.22249.1018.camel@gandalf.stny.rr.com> Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1783 Lines: 58 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/