Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5984572rwr; Tue, 9 May 2023 08:44:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7EjpfFcMvDXPuZzBOv41tr3IjHknQ9xZxQnASn9bd9rfWT9LWT2N5igELsk358I0eWYjG3 X-Received: by 2002:a17:902:c950:b0:1ac:71ae:ce2f with SMTP id i16-20020a170902c95000b001ac71aece2fmr11646658pla.20.1683647054109; Tue, 09 May 2023 08:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683647054; cv=none; d=google.com; s=arc-20160816; b=Yepk8fCjaeDhf6YTrBD9FqH6OMFud5MFsP9WbIxZgEX9jo6aDM9CEo344yyCn+Lsll QZ/2ISiIOE4OSnzSFTpd46Ib0K3cBHOlrXM+W7ZHk/syGFC23L/qlrNePK01uKGb85fG bZk/5sLCZBdm6z76PfnbmI6SLHEOZ8Rvz0U0cz82JThwJQ7rjpvqybFs7oAQkKs1eTO1 cEXamivAbIw9pD9Dzk7IHEVEawrgjYlvQVonXc2Tmb1wzWs6txn3K7ykKj/buZy4R3Vt vz/OMRL4Rt+Pv14dZvCPJbmPcLmg0O7Ehm67Kkj13a4+Npg0tDkz4QrhJgwheB4WmsMO lw3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ko7fzt9nOGMj8UcJACPmdJ37rpoFvFpIcWe4r0HuiUA=; b=sg2guNjNjYofefgO+if9Y2jxEuBJkbPDzQekS3SKmDlEItYb+d51v+EHCv/BfYOweb glqREWwxvyn1mFQgUUa5L1EMlIwA2WEH1duG5cEGD3AnljdTcMpOmQfH/nwZkvvuJlpD nFhfyo0vaCPIViOn+wUrUMd3matfEoWbjdttu7ZfkQs+7ImQZiiafiRbuYHJ4wsazxDM Gl/1bOAszLTqHR24mohADBCkK1vU25S72K/NyI10mt0ohca7D1NZO20ZXq5VR0TRttlz BfDL797e9RK9uXvSOsOeUQT5pa9FQAgWXMHxSbwRgSWz4AMamEB1ceMk97qs+3g295tn 8COw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sTgTHurD; 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 u9-20020a170902e80900b001a6527f6adbsi1920926plg.137.2023.05.09.08.43.57; Tue, 09 May 2023 08:44:14 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=sTgTHurD; 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 S235628AbjEIPYp (ORCPT + 99 others); Tue, 9 May 2023 11:24:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjEIPYo (ORCPT ); Tue, 9 May 2023 11:24:44 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14CA01729; Tue, 9 May 2023 08:24:43 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f1fe1208a4so3885793e87.2; Tue, 09 May 2023 08:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683645881; x=1686237881; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ko7fzt9nOGMj8UcJACPmdJ37rpoFvFpIcWe4r0HuiUA=; b=sTgTHurDmGKxDtOnlVSkAhLPkTW1zo3AeBefovmRj/j61oY+wmDqzx3EK5fembdMXn fedDkv/XL9zQOZbz0OHhjmU20y29cAXQIa6oMDih0EfFzRSXYvz865vlB9yQZnuGMpwz LWNw1WVOO0NQUj8BY+F7Y3O1Vbpi2uUUzdxHpW49kEfdn9CJCXKaFhXIePtAwKTJFF9m SDAitzKH+ViHP0jcp1ZhIx4jQb2dtuRt9ccYJ2Bxd59GEZZIXoEEVZsKafK/Ot2DueJm aXGzw760HZrwAvbkLUCndnGUaD/XNpvmUj6OUnmjhIlJXH/Dk8+DA39gy1Ng2lxZNG9D dp/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683645881; x=1686237881; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ko7fzt9nOGMj8UcJACPmdJ37rpoFvFpIcWe4r0HuiUA=; b=SP3PLfEn3MIlrPReK5GM5luhl0roitz3p/wxHSLCtX7eH2NFR4E6TP4SqOeFsV5Qvx t/1Fy7gvF5rX9T8C8oqvX2CgFtENTiwoGFlIA1UUx5PCQeRajW2kcpaSnaEcjK3kPkS8 BlOq/dZL/EQ4MOJLVS17dEtt/DRDXRf0alCqidm6Cz0cERDu7IvgxLj2IRjc2DZjk/19 6kRixxxt006sVz8Z+rHr7LP5PJe4AqdQw52hLoWV3LYIhYUqA+867xM6U+Lj1L0Kw13K J9BLyRpgTuLzQcZO4eXJb3C7gGqyYP+7KlaLYoRsFBnJ6n9VWAKeR60QUxCQmJnRIWrc 79RQ== X-Gm-Message-State: AC+VfDx6kWOjqP2zHh6VFxqipiTq+7OuJn1B0UFqTOA0IYZwhIcms6aI n3JMTW9OSDK47brV4VYYJdBfNDlY9HIZyeKrwpAC9sBHSbY= X-Received: by 2002:a2e:3012:0:b0:2a7:a719:5943 with SMTP id w18-20020a2e3012000000b002a7a7195943mr885570ljw.40.1683645880861; Tue, 09 May 2023 08:24:40 -0700 (PDT) MIME-Version: 1.0 References: <20230508163751.841-1-beaub@linux.microsoft.com> In-Reply-To: <20230508163751.841-1-beaub@linux.microsoft.com> From: Alexei Starovoitov Date: Tue, 9 May 2023 08:24:29 -0700 Message-ID: Subject: Re: [PATCH] tracing/user_events: Run BPF program if attached To: Beau Belgrave Cc: Steven Rostedt , Masami Hiramatsu , LKML , linux-trace-kernel@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Mon, May 8, 2023 at 9:38=E2=80=AFAM 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 infrastructur= e > and only utilizes the GPL exported function that modules and other > components may use for the same purpose. This keeps user_events consisten= t > with how other kernel, modules, and probes expose tracepoint data to allo= w > 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. There must be a different way to solve your user needs and this is not bpf.