Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp37863ybi; Tue, 16 Jul 2019 15:47:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjOqFCoQggOy37ySRXg1jXUogyJVr+lyeg3tvS5+gsyKfyoykfjvGUrqzhspNY2MkKQEXe X-Received: by 2002:a17:902:8548:: with SMTP id d8mr38855980plo.100.1563317242747; Tue, 16 Jul 2019 15:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563317242; cv=none; d=google.com; s=arc-20160816; b=SaE73kQlRAcOVA4LbnHcGMF7BQRIQS3PG2b398QNiIuWx1qwviVVX0DsSPO86e07Rd 9UpbwJ6V9/NqoqTAuz7qeK2ylWWT3pQaZK9z7qvCCm+yX4brw+2VVR/uGvcdTe0DXFog u8wXWfLTBqf+ruPSO2LWOCT2DBKnpdHHsIIlpX3ggqheOGJlgh8V++JscbeJ1GBuOJtr dhSHaA/EEdmo3AHXnb592mbg8UMrP3TvRfb7iD2yVTHKgevVgW8JcUA3tp16j+U1RjsQ dKOvMYjRA7VOhqbMVPalbNSS+IfuUXl1NSdP/bX9aXARXiJC7QhGFJr3Y5bdeQAzeFU5 wanQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ZSafqs3dk1A2a56ZSTzxAgkROhKDh2sVg3+f4ANr2sM=; b=WGePVeygzfGHWmZmQfykzVV3I8jN9+46KLphEWfldYcSSX2ApSJjBS2p7q6V7qUR+T UOQJm3BFlAYaqerpmuuNkbLACwaoc103Ax67MAFb6jwYuN03XJ69fn14g9J1YUpyaK+O dRlQLdXm2jBjS/8U3LehKCKrRdm7aX/+fSznZ/uKOInDJxJy2Bq5tBiejoAlhrN3eIWM UiV+wzX64b6U88kSQjqlTFYkSbmT5LE7/Wpredgzww3IKyraGomPtmO2Z6suwrPbx0WB xczAhQ7b0LoKUBZc4KYsMJMIQB0s1kVIcNK9DaxCrlqdSIfYXF0ZoxFXEWI244EkjmML mVmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=ZI1yhSOd; 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 s24si16385498pfh.227.2019.07.16.15.47.06; Tue, 16 Jul 2019 15:47:22 -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; dkim=pass header.i=@joelfernandes.org header.s=google header.b=ZI1yhSOd; 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 S2389135AbfGPWqN (ORCPT + 99 others); Tue, 16 Jul 2019 18:46:13 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:33739 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389083AbfGPWqK (ORCPT ); Tue, 16 Jul 2019 18:46:10 -0400 Received: by mail-pl1-f194.google.com with SMTP id c14so10840768plo.0 for ; Tue, 16 Jul 2019 15:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ZSafqs3dk1A2a56ZSTzxAgkROhKDh2sVg3+f4ANr2sM=; b=ZI1yhSOdixGSXYRM8nMQJMpxZPSxUBBqzzBaw5lkJo+7fde9KlpWC1LQ+fhLtq7daw HbJErpZtJFQJXqsBg50w3Vo2QMjtDAoaDiO2ph/vkhiE0yfB7y9COm360VK5tiWw4+8b 0JhZeVsAGRo4FXaSTlItAM+r4mOxe19m1R3iY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ZSafqs3dk1A2a56ZSTzxAgkROhKDh2sVg3+f4ANr2sM=; b=PZA1AO2oSVQwYh3stLtFKySEdJWykbGBtAyrYmmBXkW7m4TRJzihpCefTRYE3G8TTl TdpTUjlaFxwp9m/Tk6W87ZUZkOxlGSMyOjUCgkp3hjAyMHfMehi+HP8U3RGGKbIVs6aU k4JKDTDpn+NhuRAY0E+eTU12o1JxsRzvgOapAwo63m2CthBK0UZem2IkTNJ+UkyYtsP2 8qt2AJi3PSY8x3PXXCg8AkG6VO5HVSYyr0PSJcMV7UlQ3hvMXMjU/KWTB9eNlqCRMJfg lS3aSIMNcsyHqXT0FhkzGX27uCZElllnZ7hmfuRkLOM5XASb98eC254EYdWECCNd7lPX Yvgg== X-Gm-Message-State: APjAAAWjx20GejeOMM+CDNuenhUU70sSyPXrefHTIm3TjAkAOf82OGsE 0NH3RIDgVMlkkcrar0w13bE= X-Received: by 2002:a17:902:a409:: with SMTP id p9mr39200676plq.218.1563317169245; Tue, 16 Jul 2019 15:46:09 -0700 (PDT) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id bo20sm16582204pjb.23.2019.07.16.15.46.07 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 15:46:08 -0700 (PDT) Date: Tue, 16 Jul 2019 18:46:06 -0400 From: Joel Fernandes To: Steven Rostedt 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: <20190716224606.GD172157@google.com> References: <20190710141548.132193-1-joel@joelfernandes.org> <20190716205455.iimn3pqpvsc3k4ry@ast-mbp.dhcp.thefacebook.com> <20190716213050.GA161922@google.com> <20190716183117.77b3ed49@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190716183117.77b3ed49@gandalf.local.home> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 16, 2019 at 06:31:17PM -0400, Steven Rostedt wrote: > 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 his problem is with doing the association of a BPF program with tracefs itself. How would you attach a BPF program with tracefs without doing a text based approach? His problem is with the text based approach per his last email. > 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. In a follow-up patch which I am still writing, I am using the trace ring buffer as temporary storage since I am formatting the trace event into it. This patch you are replying to is just for raw tracepoint and yes, I agree this one does not use the ring buffer, but a future addition to it does. So I don't think the association of this patch series with ftrace is going to be an issue IMO. thanks, - Joel