From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B4473D0C4; Sat, 30 Mar 2024 19:34:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711827277; cv=none; b=YoheHQCwU97uQo+xudd2h3ClRewTSv/eF/bDkPF4HNq9bt66enuMKXss0wqsSsV7OjyDjT62P22UzPXkfUuiHKkgX5FSd5QeoCd6qS4EjA1PvLkPY0DTzur7O8cDERWdQE9lKEHstHmXOBQxPapuU4/+4GX6kDKP/bB48X7pDl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711827277; c=relaxed/simple; bh=IHIoHtO2KuQZl7NN/ObXXfqCusrYwTWnOIX/b02/2KU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZWB8Nhrz9oRAfu04pqW9OUG3BgwMG7UPsnaKrWIj+ObZhlBFG/v2m1kbKkvZoXmDr5uYwp52OjyfqUMafjq1C3wckR2qhjipOJrIdhZjnGwCsLTEy4C9hhepIZlKGDY+pL5xDaiVaJ7A1iQYdZiV2PFl4/Vot/pcJE13o5fGjo8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CAE4AC433F1; Sat, 30 Mar 2024 19:34:33 +0000 (UTC) Date: Sat, 30 Mar 2024 15:37:22 -0400 From: Steven Rostedt To: =?UTF-8?B?5qKm6b6Z6JGj?= Cc: Alexei Starovoitov , Jiri Olsa , Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Eddy Z , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , "David S. Miller" , David Ahern , Dave Hansen , X86 ML , Mathieu Desnoyers , Quentin Monnet , bpf , linux-arm-kernel , LKML , linux-riscv , linux-s390 , Network Development , linux-trace-kernel@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , linux-stm32@st-md-mailman.stormreply.com Subject: Re: [External] Re: [PATCH bpf-next v2 1/9] bpf: tracing: add support to record and check the accessed args Message-ID: <20240330153722.65104301@gandalf.local.home> In-Reply-To: References: <20240311093526.1010158-1-dongmenglong.8@bytedance.com> <20240311093526.1010158-2-dongmenglong.8@bytedance.com> <20240328111330.194dcbe5@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, 30 Mar 2024 11:18:29 +0800 =E6=A2=A6=E9=BE=99=E8=91=A3 wrote: > > If you really want to have thousands of functions, why not just registe= r it > > with ftrace itself. It will give you the arguments via the ftrace_regs > > structure. Can't you just register a program as the callback? > > =20 >=20 > Ennn...I don't understand. The main purpose for > me to use TRACING is: >=20 > 1. we can directly access the memory, which is more > efficient. I'm not sure what you mean by the above. Access what memory? > 2. we can obtain the function args in FEXIT, which > kretprobe can't do it. And this is the main reason. I didn't mention kretprobe. If you need access to the exit of the function, you can use Masami's fgraph update. fentry -> ftrace_trampoline -> your_code For fgraph: fentry -> ftrace_trampoline -> fgraph [sets up return call] -> your_entry_= code function ret -> fgraph_ret_handler -> your_exit_code And you will be able to pass data from the entry to the exit code, including parameters. -- Steve