Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp652499lqz; Sat, 30 Mar 2024 12:34:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVqKiN1iZAMbLK3TDexdar6PKkxDlak/pANZ04caYcd7kwBWv9oFZh1fTlxqPp7xyGdsTkNZ8XwUhUB7aw98JbAkX90DXW2RnUi2KpkRg== X-Google-Smtp-Source: AGHT+IFg/VGaXsXlejZYjWLoGZrMxriiK/cJS98N3JfzrmDFVpLLP08sR0g6yev3HsnigBxs/ZkB X-Received: by 2002:a50:d74d:0:b0:566:ab2b:e1ce with SMTP id i13-20020a50d74d000000b00566ab2be1cemr4047422edj.18.1711827289914; Sat, 30 Mar 2024 12:34:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711827289; cv=pass; d=google.com; s=arc-20160816; b=q1qsrR9rMBgh65ZXKRIoyLLjFB7DKGIwWzanMny6bB2rU0MnvUDnnuOTetxkptS+8c 1uYi84C7xKAI9cQrhk0ztLOvwy8Q9x1xEn40nuWmYjzgVgR/sKG96PRVGH/JxuDUmkmr QUsk2dVz8EFCs1tO4eOhCVz9NSmk5HLGV6jxv3OISr9fCk6F6Ds9yZ/hZX0770OsN6/H BoakXiEJsNFgk/sKzWOHaLWFx2O+9SMExhEoJNZR0sG2GZvCm4F1NB2tutHNPTCZwCpz KzE6U5aGYz9PRcEIrvS8FnnyUjoQCsvF2RI6jeV7psVLMBrz3pF/rUm6rDlJ9yX700AG qP9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=/wocdZZFwasdG8tU1QjxdHP3vED6jHyL6ZaVVYAIM0w=; fh=vud8XuGoTzKZUbXmvvIOnRH0inmpUotHSHOikfyCb88=; b=0hgEBrR8VlXNhfzGliYGnLEYGUJCyeZy+xG9SdWrwieNtw1t1OnHLU0MHJNlJknOPW i3h8EshybN7z8NvLF2kJbE6CN4Mh+XQcIfpYBrhQRoRj7jEp+rtC4D7Gw45WOcBiCdZI GAyY2IDRC0KSyQ9rsNfbVeeqcPETmEg2E/lFbRiCJrzvmiZA1IliJmn8++UYcBVePDEu cKFtBDrWo4VK1+ft3M7+ZGAoKjA84YBTUHkzanyHbhWPqfaEj13GAqODqkkeLilt2Pot uL1GzSYS3Kb7FNxpuSaRTUZbpTnCxiTMdMlCDziIRFOvw0Kq2vQmLIggnGChhIk3Uscx i7uw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-125827-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125827-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b60-20020a509f42000000b0056dc91cdfbbsi233820edf.130.2024.03.30.12.34.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 12:34:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125827-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-125827-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125827-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9D4831F231CB for ; Sat, 30 Mar 2024 19:34:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2BF0B433BD; Sat, 30 Mar 2024 19:34:38 +0000 (UTC) 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: linux-kernel@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