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 7278DCED24D for ; Tue, 8 Oct 2024 00:56:32 +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=O1OrairncSGdcGoFvlY4mSqBqXBQ7N0yPJWQn/POrHA=; b=fmW+p7OScTPQiaU6bbyDQz1Ip8 XhjTewogKsKmKvnGSxnTlYT3B4UaBIrZU3f3dqOa0UvPMxcVl2pzq8VSD7RLClFceJeZ92Mh6zJjW ZeY8xQmb3SeCn6pk6pbW6VBWXLPsgJH0NDyOLGPrld2Zd4dsW7mA4s8wvTbFnXuvOiculBmwZxF5Q K51fkP9RZwsaRIBegKZL+ML7w51JcX3UifMewoI4O2e/ZFQMlyICC7jzO9uBzOOMiWiH/p2fcwMvn WkV030JQ9Q7zWqI8gZ0Ha4TSLX3O5OB1xNWVOX5aisJpYjKupf5cdEt5Z+fdb0e+lrVONxsKqwzct VRKbK/Iw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sxyWV-000000049Je-126d; Tue, 08 Oct 2024 00:56:23 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sxyVC-000000049CU-2ALP; Tue, 08 Oct 2024 00:55:04 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0C9975C5D9A; Tue, 8 Oct 2024 00:54:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36669C4CEC6; Tue, 8 Oct 2024 00:54:57 +0000 (UTC) Date: Mon, 7 Oct 2024 20:54:58 -0400 From: Steven Rostedt To: LKML , Linux Trace Kernel , linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, "linux-arch@vger.kernel.org" , "x86@kernel.org" Cc: Masami Hiramatsu , Mathieu Desnoyers , Mark Rutland , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao , Madhavan Srinivasan , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen Subject: Re: [PATCH] ftrace: Make ftrace_regs abstract from direct use Message-ID: <20241007205458.2bbdf736@gandalf.local.home> In-Reply-To: <20241007204743.41314f1d@gandalf.local.home> References: <20241007204743.41314f1d@gandalf.local.home> 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-20241007_175502_840585_73480C6E X-CRM114-Status: GOOD ( 10.41 ) 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 Mon, 7 Oct 2024 20:47:43 -0400 Steven Rostedt wrote: > +#ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS > +struct __arch_ftrace_regs { > + struct pt_regs regs; > +}; > + > +#define arch_ftrace_get_regs(fregs) \ > + ({ struct __arch_fregs_regs *__f = (struct __arch_ftrace_regs *)(fregs); \ > + &__f->regs; \ > + }) I wrote the arch_ftrace_get_regs() at the start of creating this patch. > + > +struct ftrace_regs; > +#define arch_ftrace_regs(fregs) ((struct __arch_ftrace_regs *)(fregs)) > + I just realized I can simplify it with: #define arch_ftrace_get_regs(fregs) ({ &arch_ftrace_regs(fregs)->regs; }) I may send a v2 (tomorrow). -- Steve