From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754217AbdCOXPG (ORCPT ); Wed, 15 Mar 2017 19:15:06 -0400 Received: from mail.kernel.org ([198.145.29.136]:45448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754195AbdCOXOD (ORCPT ); Wed, 15 Mar 2017 19:14:03 -0400 Date: Wed, 15 Mar 2017 19:13:58 -0400 From: Steven Rostedt To: Josh Poimboeuf Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Masami Hiramatsu , "H. Peter Anvin" , Andy Lutomirski , Linus Torvalds Subject: Re: [RFC][PATCH 5/5] ftrace/x86-32: Add -mfentry support to x86_32 with DYNAMIC_FTRACE set Message-ID: <20170315191358.024ea325@gandalf.local.home> In-Reply-To: <20170315215545.co7elr7b3lguwaiu@treble> References: <20170315195527.703131481@goodmis.org> <20170315200255.828608428@goodmis.org> <20170315215545.co7elr7b3lguwaiu@treble> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 15 Mar 2017 16:55:45 -0500 Josh Poimboeuf wrote: > On Wed, Mar 15, 2017 at 03:55:32PM -0400, Steven Rostedt wrote: > > +#ifdef USING_FRAME_POINTER > > +# ifdef CC_USING_FENTRY > > + /* > > + * Frame pointers are of ip followed by bp. > > + * Since fentry is an immediate jump, we are left with > > + * parent-ip, function-ip. We need to add a frame with > > + * parent-ip followed by ebp. > > + */ > > + pushl 4(%esp) /* parent ip */ > > pushl %ebp > > movl %esp, %ebp > > - > > + pushl 2*4(%esp) /* function ip */ > > +# endif > > + /* For mcount, the function ip is directly above */ > > + pushl %ebp > > + movl %esp, %ebp > > +#endif > > More vertical operand alignment issues. > > > @@ -85,6 +140,10 @@ ENTRY(ftrace_regs_caller) > > pushl %edx > > pushl %ecx > > pushl %ebx > > +#ifndef USING_FRAME_POINTER > > + /* Load 4 off of the parent ip addr into ebp */ > > + lea 14*4(%esp), %ebp > > +#endif > > Instead of: > > #ifndef USING_FRAME_POINTER > > Shouldn't it be: > > #ifdef CC_USING_FENTRY > > ? > > Otherwise, if I'm reading it right, with fentry and > CONFIG_FRAME_POINTER=y, ebp will lead to the grandparent's ip instead of > the parent's ip. Yep I think you're right. I original added frame pointer setup for the parent on CC_USING_FENTRY and FRAME_POINTER but that got ugly, this may be leftover from that. Thanks, will update. -- Steve