From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752724AbbKYQUA (ORCPT ); Wed, 25 Nov 2015 11:20:00 -0500 Received: from smtprelay0183.hostedemail.com ([216.40.44.183]:51251 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752049AbbKYQT7 (ORCPT ); Wed, 25 Nov 2015 11:19:59 -0500 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 57,3.5,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:1981:2194:2199:2393:2553:2559:2562:2693:2907:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:5007:6119:6261:7875:7903:8660:10013:10400:10848:10967:11232:11658:11914:12296:12517:12519:12740:13069:13148:13230:13311:13357:13972:14096:14097:14659:21080:30054:30070: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:2:0,LFtime:4,LUA_SUMMARY:none X-HE-Tag: wren00_39d8602101133 X-Filterd-Recvd-Size: 2476 Date: Wed, 25 Nov 2015 11:19:56 -0500 From: Steven Rostedt To: Jiri Olsa Cc: lkml , David Ahern , Ingo Molnar , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: Re: [PATCH 1/2] ftrace: Add separate handler for ftrace:function event Message-ID: <20151125111956.7d53da99@gandalf.local.home> In-Reply-To: <1448466333-28102-1-git-send-email-jolsa@kernel.org> References: <1448466333-28102-1-git-send-email-jolsa@kernel.org> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; 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 Wed, 25 Nov 2015 16:45:32 +0100 Jiri Olsa wrote: > Having following commands running concurently: > > # perf record -e ftrace:function -a -o krava.data sleep 10 > # perf record -e ftrace:function --filter 'ip == SyS_read' ls > > will endup in the latter one failing on the filter > rules and store all functions (in perf.data) as > instructed by the first record instead of just > SyS_read records. > > The reason is that we don't check the ftrace_ops that > triggered the event with event's ftrace_ops. Hence > once running together the event from latter perf will > get all the data of the event from the first one. > > Fixing this by having separate handler for ftrace:function > event that actualy checks ftrace_ops against event. This seems redundant. I never understood the control_ops that perf uses in the function tracing infrastructure. Why can't you just register the event->ops and have that ops set the filtering? Then the ftrace infrastructure will only call that event handler for the functions its filtered on. Then you don't need to do it again. Right now ftrace already does that with the generic "control_ops" that perf uses, but now you are doing it again. Seems rather pointless. I may need to spend some time looking at how perf uses the function tracing, and perhaps we can remove a lot of this redundancy. -- Steve > > Signed-off-by: Jiri Olsa > ---