From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E672C433F5 for ; Thu, 24 Feb 2022 01:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EQb0VmbGCIRv/VuiHlT9jTfmzDnQbnWDt71NfELnjf8=; b=r1LMm/cyljB7EC L84Zz/ls621GXPhKsKFGZhPda71+a9qa/4WnJzkrIz9rfexz1Zle/RRUT3dymNYbsAffRR4uZWHO8 YJ3G/zQqgFDPPHLe4dEH5Br0VLgyMeS/lhKAmHuGXyVlMggZqa3ozi0oXxA7WGsro4J9UPrMyZPSP pnhiY3DXrqnfFEMqbuneEbtjO5RJivXp3yagIPSidJinspDkghcCp8OQzlxT/xlbckxyvGyJVu/vS vh5s/Tu6DEA+r/eUskVE03dV4ouzJNLo1ldq3gd9UPO0FpMsAqQuPaO0lraUcCvmIKNhXyv3vfAV1 yvnxcVc889IuJQVHgcrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nN2xP-00GS1g-N5; Thu, 24 Feb 2022 01:30:11 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nN2xL-00GS04-EV for linux-arm-kernel@lists.infradead.org; Thu, 24 Feb 2022 01:30:09 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DF557B82355; Thu, 24 Feb 2022 01:30:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3ACFAC340E7; Thu, 24 Feb 2022 01:30:03 +0000 (UTC) Date: Wed, 23 Feb 2022 20:30:01 -0500 From: Steven Rostedt To: Chengming Zhou Cc: mingo@redhat.com, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, broonie@kernel.org, songmuchun@bytedance.com, qirui.001@bytedance.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [External] Re: [PATCH] arm64/ftrace: Make function graph use ftrace directly Message-ID: <20220223203001.1158d9d4@rorschach.local.home> In-Reply-To: <5d64733b-8d2a-4928-c4dc-ce4f3b5fc561@bytedance.com> References: <20220222130049.81284-1-zhouchengming@bytedance.com> <20220222105218.28e3d5aa@gandalf.local.home> <5d64733b-8d2a-4928-c4dc-ce4f3b5fc561@bytedance.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220223_173007_673488_B02A2C17 X-CRM114-Status: GOOD ( 15.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 23 Feb 2022 16:00:27 +0800 Chengming Zhou wrote: > Yes, it would be better to implement DYNAMIC_FTRACE_WITH_ARGS on arm64 too, > and this patch just use DYNAMIC_FTRACE_WITH_REGS to install return_hooker > for graph tracer, so it's a code cleanup, no performance optimization. I'm worried that a clean up is either breaking the design or hurting performance. You have: > +void ftrace_graph_func(unsigned long ip, unsigned long parent_ip, > + struct ftrace_ops *op, struct ftrace_regs *fregs) > +{ > + struct pt_regs *regs = arch_ftrace_get_regs(fregs); Now, technically, arch_ftrace_get_regs() is to return NULL if the ftrace_ops was not registered with ops->flags |= FTRACE_OPS_FL_SAVE_REGS. Which function graph does not do. But this is in arch specific code so you have more control of this "undefined behavior". But you really should have a comment saying that this needs to be fixed when DYNAMIC_FTRACE_WITH_ARGS is implemented. -- Steve > + unsigned long *parent = (unsigned long *)&procedure_link_pointer(regs); > + > + prepare_ftrace_return(ip, parent, frame_pointer(regs)); > +} -- Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel