From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbcDRWQg (ORCPT ); Mon, 18 Apr 2016 18:16:36 -0400 Received: from smtprelay0235.hostedemail.com ([216.40.44.235]:33918 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751343AbcDRWQe (ORCPT ); Mon, 18 Apr 2016 18:16:34 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::::,RULES_HIT:41:355:379:467:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:5007:6119:6120:6261:6742:7875:7901:7903:8603:9040:10004:10400:10848:10967:11026:11232:11658:11914:12296:12438:12517:12519:12740:13069:13161:13180:13229:13311:13357:13439:14096:14097:14181:14659:14721:21080:30012:30036:30054:30056:30064:30085:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: crate39_734a994de6a63 X-Filterd-Recvd-Size: 2924 Date: Mon, 18 Apr 2016 18:16:31 -0400 From: Steven Rostedt To: Alexei Starovoitov Cc: Peter Zijlstra , "David S . Miller" , Ingo Molnar , Daniel Borkmann , Arnaldo Carvalho de Melo , Wang Nan , Josef Bacik , Brendan Gregg , , , Subject: Re: [PATCH net-next 2/8] perf, bpf: allow bpf programs attach to tracepoints Message-ID: <20160418181631.2efee46e@gandalf.local.home> In-Reply-To: <571554EB.9010702@fb.com> References: <1459831974-2891931-1-git-send-email-ast@fb.com> <1459831974-2891931-3-git-send-email-ast@fb.com> <20160418162905.220df2f4@gandalf.local.home> <571554EB.9010702@fb.com> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; 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 List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Apr 2016 14:43:07 -0700 Alexei Starovoitov wrote: > I was worried about this too, but single 'if' and two calls > (as in commit 98b5c2c65c295) is a better way, since it's faster, cleaner > and doesn't need to refactor the whole perf_trace_buf_submit() to pass > extra event_call argument to it. > perf_trace_buf_submit() is already ugly with 8 arguments! Right, but I solved that in ftrace by creating an on-stack descriptor that can be passed by a single parameter. See the "fbuffer" in the trace_event_raw_event* code. > Passing more args or creating a struct to pass args only going to > hurt performance without much reduction in .text size. > tinyfication folks will disable tracepoints anyway. > Note that the most common case is bpf returning 0 and not even > calling perf_trace_buf_submit() which is already slow due > to so many args passed on stack. > This stuff is called million times a second, so every instruction > counts. Note, that doesn't matter if you are bloating the kernel for the 99.9% of those that don't use bpf. Please remember this! Us tracing folks are second class citizens! If there's a way to speed up tracing by 10%, but in doing so we cause mainline to be hurt by over 1%, we shouldn't be doing it. Tracing and hooks on tracepoints are really not used by many people. Don't fall into Linus's category of "my code is the most important". That's especially true for tracing. These macros causes bloat. There's been many complaints about it. There's a way around it that isn't that bad (with the descriptor), we should be using it. -- Steve