Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp26668ybi; Tue, 16 Jul 2019 15:32:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyheeMsEFF2e+pjRLufl8IUB+sMMpHfCezl5KmQFBW5oW5xDPixoalqFtAO7CLM0h1Dn9k+ X-Received: by 2002:a17:90a:ae12:: with SMTP id t18mr40489887pjq.32.1563316359256; Tue, 16 Jul 2019 15:32:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563316359; cv=none; d=google.com; s=arc-20160816; b=yViLKnxVrF6uCb//RK+kIfa9n6/MegwZyZRCQEBBXkh98K4nWWdU/zADEMq46tImrx 1G+TKdRFHLyWfbRt2l4Zad8bxl6NVJXy9otuAwxxhj8IRcKZQskiWo7K3s3U01/Iy1Fa +8JXyLToKA7JjnH+AJhx5gFGhLoLnsfGqfSDsZEtxYvj/3FcGXxvGKigaszF4GZ/b5bb VRYUyBKeQwSwsJHWBB4exmEQmbTjGZnAFYmXOvpyu4woM4I2IJXWc1yX9pI96h4Jwal5 1VDN6PvrSpTbJJ6E8b7O1k+P6gDm0iN4VLtOndpaI/GQPTcZ1yZe7oJQaAqOY2pX64fU tyWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=VO3YK7/9vJ+t1jZiD6hfjFeAdmVCBj+xX/gUjJ8aIOI=; b=Sf1tnp70wdm+hxwevY3wYSS8OZWfqhmDOHOkH4M6uyYaa7uriSjk5WMa8eWkxeFLdn L/+572qUvB3T24cgWSD+9PKTiIDD1/NUNIgw4pRUmYFlxz6wwkw2EFjVazpq1OAWWWI8 eOkIu17Qq79dOt8t1jMhdwi36uM78DWW5agGGqT9BgGbcM/+6iUCIUV3Xsu5zh1t6Yog c1O4/DQmo9wmOVC7sc/y3wD88eGbKawtDcN+VvW3UlowPSXaEPdF9DGp218ZMPm5z20P FXAp1UZY6rUhSohAYgR+aUyolu6RbdgnRVjqnj/pLpDc8Ah5tKLeX7MOlo1H7FQJPWTx d3Ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q39si21001220pjc.55.2019.07.16.15.32.23; Tue, 16 Jul 2019 15:32:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388757AbfGPWbY (ORCPT + 99 others); Tue, 16 Jul 2019 18:31:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:56758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728986AbfGPWbX (ORCPT ); Tue, 16 Jul 2019 18:31:23 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D0DCF206C2; Tue, 16 Jul 2019 22:31:19 +0000 (UTC) Date: Tue, 16 Jul 2019 18:31:17 -0400 From: Steven Rostedt To: Joel Fernandes Cc: Alexei Starovoitov , linux-kernel@vger.kernel.org, Adrian Ratiu , Alexei Starovoitov , bpf@vger.kernel.org, Brendan Gregg , connoro@google.com, Daniel Borkmann , duyuchao , Ingo Molnar , jeffv@google.com, Karim Yaghmour , kernel-team@android.com, linux-kselftest@vger.kernel.org, Manali Shukla , Manjo Raja Rao , Martin KaFai Lau , Masami Hiramatsu , Matt Mullins , Michal Gregorczyk , Michal Gregorczyk , Mohammad Husain , namhyung@google.com, namhyung@kernel.org, netdev@vger.kernel.org, paul.chaignon@gmail.com, primiano@google.com, Qais Yousef , Shuah Khan , Song Liu , Srinivas Ramana , Tamir Carmeli , Yonghong Song Subject: Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace Message-ID: <20190716183117.77b3ed49@gandalf.local.home> In-Reply-To: <20190716213050.GA161922@google.com> References: <20190710141548.132193-1-joel@joelfernandes.org> <20190716205455.iimn3pqpvsc3k4ry@ast-mbp.dhcp.thefacebook.com> <20190716213050.GA161922@google.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 16 Jul 2019 17:30:50 -0400 Joel Fernandes wrote: > I don't see why a new bpf node for a trace event is a bad idea, really. > tracefs is how we deal with trace events on Android. We do it in production > systems. This is a natural extension to that and fits with the security model > well. What I would like to see is a way to have BPF inject data into the ftrace ring buffer directly. There's a bpf_trace_printk() that I find a bit of a hack (especially since it hooks into trace_printk() which is only for debugging purposes). Have a dedicated bpf ftrace ring buffer event that can be triggered is what I am looking for. Then comes the issue of what ring buffer to place it in, as ftrace can have multiple ring buffer instances. But these instances are defined by the tracefs instances directory. Having a way to associate a bpf program to a specific event in a specific tracefs directory could allow for ways to trigger writing into the correct ftrace buffer. But looking over the patches, I see what Alexei means that there's no overlap with ftrace and these patches except for the tracefs directory itself (which is part of the ftrace infrastructure). And the trace events are technically part of the ftrace infrastructure too. I see the tracefs interface being used, but I don't see how the bpf programs being added affect the ftrace ring buffer or other parts of ftrace. And I'm guessing that's what is confusing Alexei. -- Steve