Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753146AbbBJOyr (ORCPT ); Tue, 10 Feb 2015 09:54:47 -0500 Received: from cdptpa-outbound-snat.email.rr.com ([107.14.166.226]:53574 "EHLO cdptpa-oedge-vip.email.rr.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752960AbbBJOyp (ORCPT ); Tue, 10 Feb 2015 09:54:45 -0500 Date: Tue, 10 Feb 2015 09:55:12 -0500 From: Steven Rostedt To: Alexei Starovoitov Cc: Ingo Molnar , Namhyung Kim , Arnaldo Carvalho de Melo , Jiri Olsa , Masami Hiramatsu , linux-api@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 linux-trace 0/8] tracing: attach eBPF programs to tracepoints/syscalls/kprobe Message-ID: <20150210095512.42d8dede@grimm.local.home> In-Reply-To: <1423539961-21792-1-git-send-email-ast@plumgrid.com> References: <1423539961-21792-1-git-send-email-ast@plumgrid.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-RR-Connecting-IP: 107.14.168.142:25 X-Cloudmark-Score: 0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1594 Lines: 34 On Mon, 9 Feb 2015 19:45:53 -0800 Alexei Starovoitov wrote: > So the overhead of realistic bpf program is 5.05963/4.80074 = ~5% > which is faster than perf_event filtering: 5.69732/4.80074 = ~18% > or ftrace filtering: 6.50091/4.80074 = ~35% Come to think of it, this is comparing apples to oranges, as you move the filtering before the recording. It would be interesting to see the ftrace speed up, if it were to use eBPF instead of its own filtering. Maybe that 35% is the filter part, and not the discard part. I just tried the dd test with count==1234 and count!=1234 and the one that drops events is only slightly slower. In this case it does seem that the most overhead is in the filter logic. But by moving it before the recording, we can not use the fields defined in the format files, as the parameters and the fields do not match in most trace points. And to use the parameters, as I have stated, there's no interface to know what those parameters are, then filtering on them is a one shot deal. Might as well write a module and hook directly to the tracepoint and do the filtering natively. That would be faster than BPF too. My point is, what's the use case? If you filter before recording, you can not use the fields of the tracepoint. That limits you to filtering only syscalls, and perhaps kprobes. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/