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 828ECC2BA15 for ; Wed, 19 Jun 2024 12:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Jm/+Z2iKnKXpxck/yvx6z0TgFOgMnpqCvbqiu0ODgRQ=; b=FFS5EkspfgOHm5Eofsif9pFjIg sM2Hify/M4NnQtUnanntJalnzdb8nQHCF84/OzCCIShrTkoD21x8ncCDBUr/yB4u527npBNtwIQj0 Y9P2EpEZfAv2+9QgmJhMi4zW1w7vw0t+kAy+rAXVKbdiOogwl78P0tYSFz2YbjNkIWoWl/AfcPOyV L17HubkRwuU4VAHBQEdSngLeFNiaLagIojxIalWI6u+1f3UbTGinuyhJclZFlpUzT9+mucxeH+LQB qsKI9llsFvN1pIjoDC+tDHrlFCNavsnK4Szv/Gq+KL+RHFCn9fPSL3X4HP8aq8OZCSWO8TjEcqJQd wpD4ZQBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJuev-00000001DNB-41dm; Wed, 19 Jun 2024 12:43:29 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJues-00000001DM6-3ZKz for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2024 12:43:29 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 6A7F4CE1E49; Wed, 19 Jun 2024 12:43:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA87AC2BBFC; Wed, 19 Jun 2024 12:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718801003; bh=8DOB/d48t2pWusmnExKrkeBR1xLBOr5S97SWCqbn0EY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tPB+k6o2hGcwArkCZuQakYDAFr5Z2cZPY/zv61ozbCT867EPZ0fppVD1vjoaUNQmN +NCkkjlqN94dzLQ9+Jw7e8pnP7XzZJs0lL8hSbjhtx/6mLtYDFGjBgv51oqH+m8+1k KCxyknyoOZSJ3RYTY3o8KD53OvAmGDjcVi+sxPBX880sc4TIKoPY+d70BwaiIiG8Hl K0VOj3SgIWgpyaHigMdAbUIoUZXsIIHOsiIIf1sMHaU3Wmc4CvTPQZEwkgGMrxS3GI +4kjzlsASwuRgmJn3MXDkL6CuwjqadD2kMrAZrfES9vuZdi9tfXuch3PsBHPrSmDuO r1gRBFbv5VJog== Date: Wed, 19 Jun 2024 13:43:18 +0100 From: Will Deacon To: Mark Rutland Cc: Puranjay Mohan , rostedt@goodmis.org, Catalin Marinas , "Madhavan T. Venkataraman" , Kalesh Singh , chenqiwu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, puranjay12@gmail.com Subject: Re: [PATCH] arm64: stacktrace: fix the usage of ftrace_graph_ret_addr() Message-ID: <20240619124318.GA3410@willie-the-truck> References: <20240618162342.28275-1-puranjay@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_054327_116240_65408BDF X-CRM114-Status: GOOD ( 21.43 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jun 18, 2024 at 06:42:54PM +0100, Mark Rutland wrote: > On Tue, Jun 18, 2024 at 04:23:42PM +0000, Puranjay Mohan wrote: > > diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c > > index 6b3258860377..2729faaee4b4 100644 > > --- a/arch/arm64/kernel/stacktrace.c > > +++ b/arch/arm64/kernel/stacktrace.c > > @@ -25,6 +25,7 @@ > > * > > * @common: Common unwind state. > > * @task: The task being unwound. > > + * @graph_idx: Used by ftrace_graph_ret_addr() for optimized stack unwinding. > > * @kr_cur: When KRETPROBES is selected, holds the kretprobe instance > > * associated with the most recently encountered replacement lr > > * value. > > @@ -32,6 +33,7 @@ > > struct kunwind_state { > > struct unwind_state common; > > struct task_struct *task; > > + int graph_idx; > > Minor nit, but could we make that: > > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > int graph_idx; > #endif > > Regardless, this looks good to me, and I've tested it with a few > stacktrace scenarios including the example from commit: > > c6d3cd32fd0064af ("arm64: ftrace: use HAVE_FUNCTION_GRAPH_RET_ADDR_PTR") > > Reviewed-by: Mark Rutland > Tested-by: Mark Rutland > > Steve, what's your plan for merging the ftrace bits, and how should we > stage this relative to that? e.g. would it make sense for this to go > through the ftrace tree along with those changes so that this doesn't > end up transiently broken during the merge window? > > Catalin, Will, do you have any preference? I think it makes most sense if this patch travels together with 29c1c24a2707 ("function_graph: Fix up ftrace_graph_ret_addr()"), so that would be via Steve's tree. In which case: Acked-by: Will Deacon Will