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 B7259CCFA16 for ; Mon, 30 Sep 2024 19:03:45 +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=HrdMVIL+48lGKR8hpnyLbzsVeWyxaVqIEnxGTssB46Q=; b=O6rchWYv2ocqk9q/mcnSaBh4iB MXTyfcZIlWmsIWKXmB2bEzEhe5l820v3szF1K2moxyQd70mDdUKZJq9+l9w+rMrhYDEeZnOJv7NZE BvTeg1Gxpje+ksxCI7/RztWhKB4IIUwTjRJ++i3HKwLGX34yLZ8thTAg47qkkiGgQoL9ALx6vSIDG EnoUNQv2r/ngA0UiQaOejsW2aHrlaEZzPw4kfweI3SZB+5/kwRv807yRLN6JWtSuRV+tqdD+pdP51 mumhoVVcD/PGgkbqfKoTZleP4Z4mqHjvLC17ggR6VKjYDaGsfhUughgYt1PAkjvnd/kC2gXGevMR0 fVAQVNsg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1svLgD-00000000aVI-3N0S; Mon, 30 Sep 2024 19:03:33 +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 1svLf0-00000000aPg-3AUV for linux-arm-kernel@lists.infradead.org; Mon, 30 Sep 2024 19:02:20 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 39BC35C53EF; Mon, 30 Sep 2024 19:02:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75599C4CEC7; Mon, 30 Sep 2024 19:02:15 +0000 (UTC) Date: Mon, 30 Sep 2024 15:03:02 -0400 From: Steven Rostedt To: Will Deacon Cc: Catalin Marinas , linux-arm-kernel@lists.infradead.org, "Masami Hiramatsu (Google)" , 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 05/19] function_graph: Pass ftrace_regs to retfunc Message-ID: <20240930150302.6c5c9f0a@gandalf.local.home> In-Reply-To: <20240917100848.GB27384@willie-the-truck> References: <172615368656.133222.2336770908714920670.stgit@devnote2> <172615374207.133222.13117574733580053025.stgit@devnote2> <20240915044920.29a86d25@rorschach.local.home> <20240917100848.GB27384@willie-the-truck> 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-20240930_120219_341629_8EE4468D X-CRM114-Status: GOOD ( 14.61 ) 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, 17 Sep 2024 11:08:48 +0100 Will Deacon wrote: > > > @@ -787,6 +789,9 @@ __ftrace_return_to_handler(struct ftrace_regs *fregs, unsigned long frame_pointe > > > } > > > > > > trace.rettime = trace_clock_local(); > > > + if (fregs) > > > + ftrace_regs_set_instruction_pointer(fregs, ret); > > Where does the instruction pointer get used after this? The arm64 > 'return_to_handler' function doesn't look at it when we return. It's for the hooks to the return instruction. kretprobes will start using function graph tracer to hook to a return of a function (via fprobes), and the callbacks will need access to the return pointer. The callbacks get passed the ftrace_regs, and this is how they can see what the function is returning to. For example, BPF programs will need this. So it's not needed for the infrastructure, only the callbacks that hook to it. -- Steve