Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3653436pxb; Fri, 4 Feb 2022 13:20:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyEj9jbYLEFlJ11e9lv6onrALKWtb9O86x460bgJ9YyLxLsQiRpCgQaTL4HtASCUGB6fmd8 X-Received: by 2002:aa7:c5cf:: with SMTP id h15mr1087606eds.352.1644009616187; Fri, 04 Feb 2022 13:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644009616; cv=none; d=google.com; s=arc-20160816; b=vQQ6AmhMPfg+23NM6jG3mmWl1HsdtuMZnGEx+8gvIGzO3f65plpebIu9fiefxyvV8/ zr44ws+TXNboRDORmRC+KV/tTfq2ZK0D++BKWSNwUH6WzPxTNS5KK57HlhGnmxNa5dfF 4JxR4wixOTRVEpH6LkZVsWidH8Ua4H+IA7f3q2aVBKDheiR5mBjf5lrr4VSCinQ+lFsh 46BP8rhsC68DGm1rA8PA+kW/53BZbmQ+6BUMGmhbD1eAgxhvMQyLAoo+4LBMjcXJXLTt VfiCm58Zwfu9b7jv5NLoLeWoxsWtwFdsq1yiBI8XEOQ4NNeVZShjczDRmSxMHD7mBR7g 7BYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1mOPyQ5UiB8kEYuS4ShMupKYCA5eSrSa5aHqsgtfLkU=; b=XEF8VI8rzk8cGmoiEiJM4NFlHnFd1Af5KZBnXiFWpK87us99gHDqp5TfAdDbyBSXeQ lvaIxotHTwXgEsXWBndGCjA08xLy3Hj72JrkYJvdDiqfp7WnbO0G1d+BClvN/tMmd67n +M8VaPGi7PXUB54Nzz83KXfWiuulbAaCW+rDpW20quQjRf9S/MTIxvV4Pkk2IrbYZpJH ePSsdpRy8RCXILDgAVbcc37C2LtpKG0QZb8bUa+j4AkZBjotnDbrk4JrqJ37DqTs7mTd 3FZx25o8EEx97XqhPnzmveTzZV/YEhO+DkUCb8vLom7fTGRp8xmuAOI17ciGRBMH/snw kiMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=lxQJNq2y; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s18si1856166edq.150.2022.02.04.13.19.50; Fri, 04 Feb 2022 13:20:16 -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=@gmail.com header.s=20210112 header.b=lxQJNq2y; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356655AbiBDCmf (ORCPT + 99 others); Thu, 3 Feb 2022 21:42:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbiBDCmd (ORCPT ); Thu, 3 Feb 2022 21:42:33 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3BEDC061714; Thu, 3 Feb 2022 18:42:33 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id t9so1731143plg.13; Thu, 03 Feb 2022 18:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1mOPyQ5UiB8kEYuS4ShMupKYCA5eSrSa5aHqsgtfLkU=; b=lxQJNq2ybkvp1A0zaaPiw437ZpsIEw5sB9BhSqof8oW0L9jykk0ZpIGOuv+dIlTaOr Ah6hBQ4Zwgnax0OxjUuLk4+zVyDVb3Ya4d4WTCvYCo8lJQpAn4sI2q7Uk/xAApFArQeO l/cVbIrEJIDzEW9lV3OjfbgOOyHQxClBUTLtfpflFdYEApfpnYf7R/HM98IoyLfayYVZ sjdLbpPFhajmT0IYpVPdu2yujLZowHLpF9eTBKa6Cm/Mo0/O4Eb9teAbTt5JrmjsBy7A OK/0QlPCknDbrIanrXQjnOs8lR0xPFiYF+t8nq1KARtlg2sw1Lfzz4Z6k++uE4wTqfgT g2rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1mOPyQ5UiB8kEYuS4ShMupKYCA5eSrSa5aHqsgtfLkU=; b=D17TdMyq/nl2GsyNnWsEBcE6GjLkx6gwo1HHCpXaofjAlbIWsaknSn8AhRnxzPKQL8 V0KYiAxbXJuNmqN0Ik7Svnhpeh/sNdUXIjO6wG4S8D8jiFDEeyRL+p+Z1tCEjCiepmT7 zP+Bu03INzmHb1aJPQMGV08OMQVh5qQNKPFNhCMupt7gV7kFVlKAq/aY4LAm6TMOli6r P6h/ddd9G7kk7k+m98IiNokPCh8pIoHW5tX6Vf/tiLTmRyelgka4T62N0/9L0iOafmEC 4dk6oRv7QL9f9EJVbNwQdJu2F8ibxHtrKU+sa/mYc5OJT//MqOqbM5NUG8Kft1/AlyXK BZlw== X-Gm-Message-State: AOAM53092nAyDNDVXZLgBK5gQXNgnT7aDtuh5yHUBJ5JKMe5ucYTtQrL yhdKy3Jkc3qWPVEYxPC9g3WuMXQs5bQbyt5vRL4= X-Received: by 2002:a17:90b:1e41:: with SMTP id pi1mr776554pjb.62.1643942553260; Thu, 03 Feb 2022 18:42:33 -0800 (PST) MIME-Version: 1.0 References: <20220202135333.190761-1-jolsa@kernel.org> <20220204094619.2784e00c0b7359356458ca57@kernel.org> <20220204110704.7c6eaf43ff9c8f5fe9bf3179@kernel.org> <20220203211954.67c20cd3@gandalf.local.home> In-Reply-To: <20220203211954.67c20cd3@gandalf.local.home> From: Alexei Starovoitov Date: Thu, 3 Feb 2022 18:42:22 -0800 Message-ID: Subject: Re: [PATCH 0/8] bpf: Add fprobe link To: Steven Rostedt Cc: 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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.