Re: [PATCH v8 tip 3/9] tracing: attach BPF programs to kprobes

2015-03-20 Thread Alexei Starovoitov
On 3/20/15 2:09 PM, Steven Rostedt wrote: +/** + * trace_call_bpf - invoke BPF program + * @prog - BPF program + * @ctx - opaque context pointer + * + * kprobe handlers execute BPF programs via this helper. + * Can be used from static tracepoints in the future. Should also state what the expe

Re: [PATCH v8 tip 3/9] tracing: attach BPF programs to kprobes

2015-03-20 Thread Steven Rostedt
On Thu, 19 Mar 2015 18:59:41 -0700 Alexei Starovoitov wrote: Some nits... > --- /dev/null > +++ b/kernel/trace/bpf_trace.c > @@ -0,0 +1,123 @@ > +/* Copyright (c) 2011-2015 PLUMgrid, http://plumgrid.com > + * > + * This program is free software; you can redistribute it and/or > + * modify it u

[PATCH v8 tip 3/9] tracing: attach BPF programs to kprobes

2015-03-19 Thread Alexei Starovoitov
User interface: struct perf_event_attr attr = {.type = PERF_TYPE_TRACEPOINT, .config = event_id, ...}; event_fd = perf_event_open(&attr,...); ioctl(event_fd, PERF_EVENT_IOC_SET_BPF, prog_fd); prog_fd is a file descriptor associated with BPF program previously loaded. event_id is an ID of created