Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2650380rwd; Mon, 15 May 2023 15:00:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5JYyapbMt3SVb+aHzjOxjnxD0lqTOOOaiXhG4fDLT9RUZkMTCoo1yIPl6hf+DrqAd3SWI2 X-Received: by 2002:a05:6a20:8426:b0:101:90e:c0cb with SMTP id c38-20020a056a20842600b00101090ec0cbmr32177294pzd.59.1684188037282; Mon, 15 May 2023 15:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684188037; cv=none; d=google.com; s=arc-20160816; b=B7PF9rQdG/I9s0fPKBQMS1PKjqL7ju5Jt3TF7ScK+p/yn80kYyawA3yx6DonRUBNDi 88naHklvT+r+BhMEpoIzXO4I5GDFvcil7/7vtsinjxyobNEdvNFhm+O8x4eAYmfL90Qt n4dxOhxeZVv9l4EmUbVZKCMbdyuyVy1Mur2BnwTxjqh3zefXMZK0lXNDU92DOMEU6pdg +yAjcS36Beh7tyXn8RNEQKPOtisqCN/av5KYBiGXcOWPGcLHZF5jrMowsHDABBk9bqI1 tHZiM2g/+r9NHkpR4yMewjsuXveV/bUtHKX1yEqTqWQRzLc2MGLyKUcPWfo5ZMdQc0lg 8Tgg== 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=ncwGHmCCVpMjs3iTAFu3tZf8RAosumF/NTP/PX6KdQo=; b=v0tHeDOgbRWxV5mUh0nLJ3f63dXTfOqL1BaRol6TwEgLzBVXpdSdLvvmx9bqEPclnT TqAuwi2SC1SNVwXSz+eawEc3hECgULLCvaV3tlSE9tIf6rpPobxUw+Teoy1m4KNE+06/ XnTVmSS7R6yyR/1qHom2WaUwHZWdkWfbNYlAEuqkmxvFZ6vamS+6joYilosir4VYOlsr 2aarETkWx3w+NevfECzPmfhDRTKIgh83S85AV6zYA4KBqrjl0ZZ/+6YU/W7qdecMVVLc UO55L/rhVjWv7ZTli/q9SBzjTTayflM3EyjDCd+V2b1zemZ+1eRRmZn6lvvA6KQ/jj5B y3iQ== 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 mt5-20020a17090b230500b002509aeecdf4si227706pjb.58.2023.05.15.15.00.24; Mon, 15 May 2023 15:00:37 -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 S245274AbjEOV5U (ORCPT + 99 others); Mon, 15 May 2023 17:57:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242711AbjEOV5R (ORCPT ); Mon, 15 May 2023 17:57:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 602DF172A; Mon, 15 May 2023 14:57:16 -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 F04FD63311; Mon, 15 May 2023 21:57:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E5ED6C433D2; Mon, 15 May 2023 21:57:13 +0000 (UTC) Date: Mon, 15 May 2023 17:57:12 -0400 From: Steven Rostedt To: Beau Belgrave Cc: Alexei Starovoitov , Masami Hiramatsu , LKML , linux-trace-kernel@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , bpf , David Vernet , Linus Torvalds , dthaler@microsoft.com, brauner@kernel.org, hch@infradead.org Subject: Re: [PATCH] tracing/user_events: Run BPF program if attached Message-ID: <20230515175712.649aa5f6@gandalf.local.home> In-Reply-To: <20230515192407.GA85@W11-BEAU-MD.localdomain> References: <20230508163751.841-1-beaub@linux.microsoft.com> <20230509130111.62d587f1@rorschach.local.home> <20230509163050.127d5123@rorschach.local.home> <20230515165707.hv65ekwp2djkjj5i@MacBook-Pro-8.local> <20230515192407.GA85@W11-BEAU-MD.localdomain> 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=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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, 15 May 2023 12:24:07 -0700 Beau Belgrave wrote: > > Beau, > > please provide a detailed explanation of your use case and how bpf helps. > > > > There are teams that have existing BPF programs that want to also pull > in data from user processes in addition to the data they already collect > from the kernel. > > We are also seeing a trend of teams wanting to drop buffering approaches > and move into non-buffered analysis of problems. An example is as soon > as a fault happens in a user-process, they would like the ability to see > what that thread has done, what the kernel did a bit before the error > (or other processes that have swapped in, etc). > > We also have needs to aggregate operation duration live, and as soon as > they deviate, trigger corrective actions. BPF is ideal for us to use for > aggregating data cheaply, comparing that to other kernel and user > processes, and then making a decision quickly on how to mitigate or flag > it. We are working with OpenTelemetry teams to make this work via > certain exporters in various languages (C#/C++/Rust). This is turning into a very productive discussion. Thank you Alexei and Beau for this. Beau, Could you possibly also add (in a separate patch), a simple use case of a BPF program that would be attached to some user event. Could be contrived. Perhaps supply a patch to ls.c[1] that adds a user event to where it reads a file type and the bpf program can do something special if the file belongs to the user. OK, I'm just pulling crazy ideas out of thin air! [1] https://github.com/coreutils/coreutils/blob/master/src/ls.c Could copy the ls with the user event to the samples directory for user events. It is GPL. -- Steve