Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-26 Thread Joel Fernandes
On Fri, Jul 26, 2019 at 3:18 PM Joel Fernandes wrote: > > On Fri, Jul 26, 2019 at 11:39:56AM -0700, Alexei Starovoitov wrote: [snip] > > > For bpf program: > > > https://android.googlesource.com/platform/system/bpfprogs/+/908f6cd718fab0de7a944f84628c56f292efeb17%5E%21/ > > > > what is

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-26 Thread Joel Fernandes
On Fri, Jul 26, 2019 at 11:39:56AM -0700, Alexei Starovoitov wrote: [snip] > > > > 1. timeinstate: By hooking 2 programs onto sched_switch and > > > > cpu_frequency > > > > tracepoints, we are able to collect CPU power per-UID (specific app). > > > > Connor > > > > O'Brien is working on that. >

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-26 Thread Alexei Starovoitov
On Wed, Jul 24, 2019 at 09:57:14AM -0400, Joel Fernandes wrote: > On Tue, Jul 23, 2019 at 03:11:10PM -0700, Alexei Starovoitov wrote: > > > > > > I think allowing one tracepoint and disallowing another is pointless > > > > > > from security point of view. Tracing bpf program can do > > > > > >

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-24 Thread Joel Fernandes
On Tue, Jul 23, 2019 at 03:11:10PM -0700, Alexei Starovoitov wrote: > > > > > I think allowing one tracepoint and disallowing another is pointless > > > > > from security point of view. Tracing bpf program can do bpf_probe_read > > > > > of anything. > > > > > > > > I think the assumption here is

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-23 Thread Alexei Starovoitov
On Wed, Jul 17, 2019 at 10:51:43PM -0400, Joel Fernandes wrote: > Hi Alexei, > > On Wed, Jul 17, 2019 at 02:40:42PM -0700, Alexei Starovoitov wrote: > > On Wed, Jul 17, 2019 at 6:01 AM Joel Fernandes > > wrote: > > > > I trimmed cc. some emails were bouncing. > > Ok, thanks. > > > > > I

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-17 Thread Joel Fernandes
Hi Alexei, On Wed, Jul 17, 2019 at 02:40:42PM -0700, Alexei Starovoitov wrote: > On Wed, Jul 17, 2019 at 6:01 AM Joel Fernandes wrote: > > I trimmed cc. some emails were bouncing. Ok, thanks. > > > I think allowing one tracepoint and disallowing another is pointless > > > from security point

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-17 Thread Alexei Starovoitov
On Wed, Jul 17, 2019 at 6:01 AM Joel Fernandes wrote: I trimmed cc. some emails were bouncing. > > I think allowing one tracepoint and disallowing another is pointless > > from security point of view. Tracing bpf program can do bpf_probe_read > > of anything. > > I think the assumption here is

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-17 Thread Joel Fernandes
On Tue, Jul 16, 2019 at 06:24:07PM -0700, Alexei Starovoitov wrote: [snip] > > > > > I don't see why a new bpf node for a trace event is a bad idea, > > > > > really. > > > > > > > > See the patches for kprobe/uprobe FD-based api and the reasons behind > > > > it. > > > > tldr: text is racy,

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Alexei Starovoitov
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.

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 07:55:00PM -0400, Joel Fernandes wrote: > On Tue, Jul 16, 2019 at 06:41:50PM -0400, Joel Fernandes wrote: > > On Tue, Jul 16, 2019 at 03:26:52PM -0700, Alexei Starovoitov wrote: > > > On Tue, Jul 16, 2019 at 05:30:50PM -0400, Joel Fernandes wrote: > > > > > > > > I also

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Joel Fernandes
On Tue, Jul 16, 2019 at 06:41:50PM -0400, Joel Fernandes wrote: > On Tue, Jul 16, 2019 at 03:26:52PM -0700, Alexei Starovoitov wrote: > > On Tue, Jul 16, 2019 at 05:30:50PM -0400, Joel Fernandes wrote: > > > > > > I also thought about the pinning idea before, but we also want to add > > >

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Joel Fernandes
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.

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Steven Rostedt
On Tue, 16 Jul 2019 15:26:52 -0700 Alexei Starovoitov wrote: > I'm absolutely against text based apis. I guess you don't use /proc ;-) -- Steve

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Joel Fernandes
On Tue, Jul 16, 2019 at 03:26:52PM -0700, Alexei Starovoitov wrote: > On Tue, Jul 16, 2019 at 05:30:50PM -0400, Joel Fernandes wrote: > > > > I also thought about the pinning idea before, but we also want to add > > support > > for not just raw tracepoints, but also regular tracepoints (events

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Steven Rostedt
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.

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Alexei Starovoitov
On Tue, Jul 16, 2019 at 05:30:50PM -0400, Joel Fernandes wrote: > > I also thought about the pinning idea before, but we also want to add support > for not just raw tracepoints, but also regular tracepoints (events if you > will). I am hesitant to add a new BPF API just for creating regular >

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Joel Fernandes
On Tue, Jul 16, 2019 at 01:54:57PM -0700, Alexei Starovoitov wrote: > On Wed, Jul 10, 2019 at 10:15:44AM -0400, Joel Fernandes (Google) wrote: > > Hi, > > why are you cc-ing the whole world for this patch set? Well, the whole world happens to be interested in BPF on Android. > I'll reply to all

Re: [PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-16 Thread Alexei Starovoitov
On Wed, Jul 10, 2019 at 10:15:44AM -0400, Joel Fernandes (Google) wrote: > Hi, why are you cc-ing the whole world for this patch set? I'll reply to all as well, but I suspect a bunch of folks consider it spam. Please read Documentation/bpf/bpf_devel_QA.rst Also, I think, netdev@vger rejects

[PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-10 Thread Joel Fernandes (Google)
Hi, These patches make it possible to attach BPF programs directly to tracepoints using ftrace (/sys/kernel/debug/tracing) without needing the process doing the attach to be alive. This has the following benefits: 1. Simplified Security: In Android, we have finer-grained security controls to