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 49497CF318D for ; Wed, 2 Oct 2024 01:01:53 +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:Content-Transfer-Encoding: Content-Type: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=FCpZFLuqaxCuO43z0/zoPC6+jDp5YLIzarjl2cSoZso=; b=zYVjIQRJNS1vzIx+CwjUtGqCu/ 2Ew4aJP6NjFj1FJtLjDStCp6DKEKJHHOAWmFEWQiX8hLz/uDR6JqoiuQ1m24LUFci6hXC6HmsUbbO Inw44p5W6vDS+xrPNLODRkocpuJPJP1Sa2/8UuzrPbxt2h81Nu9V4pmUST9NdoMNsmSkR+uw9XGQ+ P6kq+d6a4noc/36olmT/CXxxTsTv+ffP5ors54/UgY8vLT4CUhLpvi8qFW0x/4IYYRPUSrOUjtrA3 Y4+w1gWE+LeQtd+cPRGfe39vkETtbZ1W7LiVegD9g7+iaLpLnlvtkZ2d8ENH7nmkNzQxo8MDqtbvm PHRvFC2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svnkO-00000004UlF-1rrH; Wed, 02 Oct 2024 01:01:44 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1svmLK-00000004NF2-3mDV for linux-arm-kernel@lists.infradead.org; Tue, 01 Oct 2024 23:31:48 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id B8B56A431B2; Tue, 1 Oct 2024 23:31:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59747C4CEC6; Tue, 1 Oct 2024 23:31:44 +0000 (UTC) Date: Tue, 1 Oct 2024 19:32:34 -0400 From: Steven Rostedt To: "Masami Hiramatsu (Google)" Cc: Will Deacon , Catalin Marinas , linux-arm-kernel@lists.infradead.org, Florent Revest , linux-trace-kernel@vger.kernel.org, LKML , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Mark Rutland Subject: Re: [PATCH v14 04/19] function_graph: Replace fgraph_ret_regs with ftrace_regs Message-ID: <20241001193234.2acb6147@gandalf.local.home> In-Reply-To: <20241002081037.e9b825f7456ce4815eccad1b@kernel.org> References: <172615368656.133222.2336770908714920670.stgit@devnote2> <172615373091.133222.1812791604518973124.stgit@devnote2> <20240915051144.445681c2@rorschach.local.home> <20240917095538.GA27384@willie-the-truck> <20240930145548.08c8f666@gandalf.local.home> <20241002081037.e9b825f7456ce4815eccad1b@kernel.org> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241001_163147_041809_D32419AD X-CRM114-Status: GOOD ( 16.75 ) 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 Wed, 2 Oct 2024 08:10:37 +0900 Masami Hiramatsu (Google) wrote: > > > > I may add some compiler hacks to enforce this. Something like: > > > > struct ftrace_regs { > > void *nothing_to_see_here; > > }; > > Yeah, OK. But sizeof(fregs) may be changed. (Shouldn't we do too?) Honestly, I don't think anything should be doing a sizeof(struct ftrace_regs) Heck, perhaps we should make it totally zero! struct ftrace_regs { long nothing_here[]; }; If someone needs to allocate, then we could provide a: ftrace_regs_size() helper function. > > > > > And then change the arch code to be something like: > > > > // in arch/arm64/include/asm/ftrace.h: > > > > struct arch_ftrace_regs { > > /* x0 - x8 */ > > unsigned long regs[9]; > > > > #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS > > unsigned long direct_tramp; > > #else > > unsigned long __unused; > > #endif > > > > unsigned long fp; > > unsigned long lr; > > > > unsigned long sp; > > unsigned long pc; > > }; > > And if it is pt_regs compatible, > > #define arch_ftrace_regs pt_regs > > ? > Only if it is fully pt_regs compatible. -- Steve