Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6128887rwr; Tue, 9 May 2023 10:34:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5yAiOdbZhS/mYv42SRcb8hwJwKJW9aiX7L32Y8e6CyrLr3K6TuR5rV5RIV8tr8IC+iPCQn X-Received: by 2002:a17:903:41ca:b0:1ac:6fc3:6beb with SMTP id u10-20020a17090341ca00b001ac6fc36bebmr11233279ple.9.1683653697620; Tue, 09 May 2023 10:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683653697; cv=none; d=google.com; s=arc-20160816; b=ZnhlOSwfqo+DCB8mFTBFJSosgns5ruk7BTBeHPFKFMZeBbQU/+0i69fCAaO5YWbGP2 J2LUzblwSSCboKEzuH6M9HjM8ZoI2TZfrFt4EYTSRuMXHJjph736HeHWmEJze3grLgI5 /Fv5X+GSzeoEHVIf++4B427tYrOcInFSfi/pyeaH/LG+sfr1y31kmIwLbpUQXCBg3Jt3 p41XVEtKdlaFvaZ7O4Z+kqroqJCU/6X4N0tzwMy5RIQuX+d8zb6PTbT5T0aVLmaqDMcx 5eUvo9iJ+95TCw9FaFNH7OVZ+UgAp4yhhk5NUFUhE91QSyNlR0n/AxE3oXIzi0E+fCEn 42aQ== 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; bh=DwCObDj8e946PLQi3I0o1v0jh8cxnlUz2lNust4j584=; b=tPaRDe7aEtOkyUrrDziONtKb9SXCDTS9G47Odzv0cQadurQ1FnuYyNAIpcQHRenXzR r9hmoZ4DKdFbPLVUC/y6zTQTP9RH+/OYorNQ9DR0h6RGlErdSh+u4MNnfypVjsEnpzgX O3CjQVX/R02+P6kkt2K3IPgrJrb7IuOAFpLQSDQ+SKgTPMep68FSg8kUtGKpqxs7sOYn 7eW6/YdHzzhzQDklGNgrzSa/arns68nCtqz3Su+x8Us2odIwdD2/8tAgdoP5ke8TlXrA Fq6Wic8aoRC1CH1dnq6FmrYQrFUqjzmLjNgniTDyNyFKCobMq17SJoPgPgJc2Dadb4ND T+9w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p17-20020a170902e75100b001a51bb4ad7dsi2039926plf.45.2023.05.09.10.34.45; Tue, 09 May 2023 10:34:57 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234728AbjEIRFl convert rfc822-to-8bit (ORCPT + 99 others); Tue, 9 May 2023 13:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235873AbjEIRFS (ORCPT ); Tue, 9 May 2023 13:05:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 149E75590; Tue, 9 May 2023 10:02:45 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 7F8AE64775; Tue, 9 May 2023 17:01:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 817A2C433D2; Tue, 9 May 2023 17:01:13 +0000 (UTC) Date: Tue, 9 May 2023 13:01:11 -0400 From: Steven Rostedt To: Alexei Starovoitov Cc: Beau Belgrave , Masami Hiramatsu , LKML , linux-trace-kernel@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf , David Vernet , Linus Torvalds Subject: Re: [PATCH] tracing/user_events: Run BPF program if attached Message-ID: <20230509130111.62d587f1@rorschach.local.home> In-Reply-To: References: <20230508163751.841-1-beaub@linux.microsoft.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 9 May 2023 08:24:29 -0700 Alexei Starovoitov wrote: > On Mon, May 8, 2023 at 9:38 AM Beau Belgrave wrote: > > > > Programs that utilize user_events today only get the event payloads via > > perf or ftrace when writing event data. When BPF programs are attached > > to tracepoints created by user_events the BPF programs do not get run > > even though the attach succeeds. This causes confusion by the users of > > the programs, as they expect the data to be available via BPF programs > > they write. We have several projects that have hit this and requested > > BPF program support when publishing data via user_events from their > > user processes in production. > > > > Swap out perf_trace_buf_submit() for perf_trace_run_bpf_submit() to > > ensure BPF programs that are attached are run in addition to writing to > > perf or ftrace buffers. This requires no changes to the BPF infrastructure > > and only utilizes the GPL exported function that modules and other > > components may use for the same purpose. This keeps user_events consistent > > with how other kernel, modules, and probes expose tracepoint data to allow > > attachment of a BPF program. > > Sorry, I have to keep my Nack here. > > I see no practical use case for bpf progs to be connected to user events. That's not a technical reason. Obviously they have a use case. This is only connecting to BPF through the API. It makes no changes to BPF itself, so I'm not sure your NACK has jurisdiction here. Their alternative is to to do it with an external module as the only connections to BPF it uses is via an EXPORT_SYMBOL_GPL() function! Again, what is your technical reason for nacking this? It's like me nacking a user of ftrace because I don't see a use case for it. That's not a valid reason to issue a nack. > > There must be a different way to solve your user needs > and this is not bpf. Why not use BPF? -- Steve