Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3717571pxb; Fri, 4 Feb 2022 14:59:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzavgTAhO7ZDxjpU8mtgjOE0tA39zxVCL685C0CUJbJZVH9XwEbYsHv/hXfUXuO2v5Vmhxt X-Received: by 2002:a17:902:d4c5:: with SMTP id o5mr5486135plg.116.1644015598073; Fri, 04 Feb 2022 14:59:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644015598; cv=none; d=google.com; s=arc-20160816; b=XqP+IpBuCwuVLTcWp5FVnfLsQCRQ1rx+x/Ws89lysajZEfBRxzjG4LMPnDJWZYO6CB aa3tz2KwdMlTANvfGKgE2ch3p8G3jHRS++CpvHU1ETzAK/XgAFuWox94hbIG/TBw565x geH0cVKsbbbRmn8znVMn58hzhpJpdggt9YDTUnX0BnxjK2r1mlKmnGaP/ah6LlKpXDqn 0AxWtSD0JZ5bZZ5+WJNH+m563g5HbcfwAARcpaqv1HNPZiY2r6HIEaHaJ7STOBpa0Q8q VSiFLWlPagzUZyo/xYBXkTbthW08c00SeZdV5qIVlP5s0g0gHmFGdtSD/THFgzgA2bDE 96DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=iyqX/SMt5//MEgApAL69DefTz4IfZ0QpYjJ9p1ZEqww=; b=oU4uems9C+rktEzaauwqE0+gZ92X4ItXhskhExSHUR4cMvLMK6LFCtaQDHEXAxKFcg H7wMavaYlslYHBQH2Hm8fXY8euykbh+RSNiu47qFkLnVf3sWiHr3fba1TDd6DqOWiBdx 7lKxZgic7QFbDfI+m83nSfi61aa+Ap2C6cUxok6252f79QDk4/pm3gXtsZ/Q8maGSJ/K pDCLpqolD94Sc1T+/BuhwIwCJ+Xlb43vWrs4sfJmbAQE1dRF5rK2BQp4Ek4kaVv+VNyD 2727Dq7BuQ4xd/2TFt0tuNd9vBOCERQYJBwTRFMPhoiTvpOLqmg3ek8dI7QhDhAzXcka yZeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NJRJKDaw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u7si3545799pfk.123.2022.02.04.14.59.46; Fri, 04 Feb 2022 14:59:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NJRJKDaw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356887AbiBDD7v (ORCPT + 99 others); Thu, 3 Feb 2022 22:59:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345345AbiBDD7u (ORCPT ); Thu, 3 Feb 2022 22:59:50 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 175E6C061714; Thu, 3 Feb 2022 19:59:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CF988B8364F; Fri, 4 Feb 2022 03:59:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCE27C004E1; Fri, 4 Feb 2022 03:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643947187; bh=lCcXf1A5cM6ZpNUg4SCoX5duKcDpWk2uRMyMgVPxB+8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NJRJKDaw9Vn190aAcLwQMQRshh4hwOeOUIItjod7QdF4mtpwbNPpSEdmpMQsawVXz vQl2uimyvZqHJHQ1AKtxxGs3K1NXh1R4PGPwm3Cq5VPDC96GSstDT9cYbtf6ujivtE 6ZDGBPD3Y1u8tdP51+9us+lp8APZbDFvo4OntNYEC6MJEimbw0vRcBGUGQUoRgx0Qt EP9skThRPo4RGT2morDxFF6zWNwpPJPdbbl+E00Ujv4+nChQIN0Tb7gnLVwRgv6eXt IBzoyVeUkUMEArllEuKtEp471sV/Ch5OW25xMEbj1d26JBu/X9CB7qkmQ6iyHI5doX WN+lJ7/Femb8A== Date: Fri, 4 Feb 2022 12:59:42 +0900 From: Masami Hiramatsu To: Alexei Starovoitov Cc: Steven Rostedt , Masami Hiramatsu , Jiri Olsa , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Network Development , bpf , lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Jiri Olsa Subject: Re: [PATCH 0/8] bpf: Add fprobe link Message-Id: <20220204125942.a4bda408f536c2e3248955e1@kernel.org> In-Reply-To: References: <20220202135333.190761-1-jolsa@kernel.org> <20220204094619.2784e00c0b7359356458ca57@kernel.org> <20220204110704.7c6eaf43ff9c8f5fe9bf3179@kernel.org> <20220203211954.67c20cd3@gandalf.local.home> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexei, On Thu, 3 Feb 2022 18:42:22 -0800 Alexei Starovoitov wrote: > On Thu, Feb 3, 2022 at 6:19 PM Steven Rostedt wrote: > > > > On Thu, 3 Feb 2022 18:12:11 -0800 > > Alexei Starovoitov wrote: > > > > > > No, fprobe is NOT kprobe on ftrace, kprobe on ftrace is already implemented > > > > transparently. > > > > > > Not true. > > > fprobe is nothing but _explicit_ kprobe on ftrace. > > > There was an implicit optimization for kprobe when ftrace > > > could be used. > > > All this new interface is doing is making it explicit. > > > So a new name is not warranted here. > > > > > > > from that viewpoint, fprobe and kprobe interface are similar but different. > > > > > > What is the difference? > > > I don't see it. > > > > IIUC, a kprobe on a function (or ftrace, aka fprobe) gives some extra > > abilities that a normal kprobe does not. Namely, "what is the function > > parameters?" > > > > You can only reliably get the parameters at function entry. Hence, by > > having a probe that is unique to functions as supposed to the middle of a > > function, makes sense to me. > > > > That is, the API can change. "Give me parameter X". That along with some > > BTF reading, could figure out how to get parameter X, and record that. > > This is more or less a description of kprobe on ftrace :) > The bpf+kprobe users were relying on that for a long time. > See PT_REGS_PARM1() macros in bpf_tracing.h > They're meaningful only with kprobe on ftrace. > So, no, fprobe is not inventing anything new here. Hmm, you may be misleading why PT_REGS_PARAM1() macro works. You can use it even if CONFIG_FUNCITON_TRACER=n if your kernel is built with CONFIG_KPROBES=y. It is valid unless you put a probe out of function entry. > No one is using kprobe in the middle of the function. > It's too difficult to make anything useful out of it, > so no one bothers. > When people say "kprobe" 99 out of 100 they mean > kprobe on ftrace/fentry. I see. But the kprobe is kprobe. It is not designed to support multiple probe points. If I'm forced to say, I can rename the struct fprobe to struct multi_kprobe, but that doesn't change the essence. You may need to use both of kprobes and so-called multi_kprobe properly. (Someone need to do that.) Thank you, -- Masami Hiramatsu