From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757343AbcCRO1a (ORCPT ); Fri, 18 Mar 2016 10:27:30 -0400 Received: from smtprelay0081.hostedemail.com ([216.40.44.81]:59178 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932772AbcCRO11 (ORCPT ); Fri, 18 Mar 2016 10:27:27 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:981:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2197:2199:2393:2553:2559:2562:2895:3138:3139:3140:3141:3142:3355:3865:3866:3867:3868:3870:3871:3872:3874:4321:4605:5007:6119:6261:7875:7903:9010:9040:10004:10226:10400:10482:10848:10967:11026:11232:11473:11658:11914:12296:12517:12519:12555:12740:13141:13230:13439:13972:14659:14721:19901:19997:21080:21212:21222:30051:30054:30070:30076:30079: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:3,LUA_SUMMARY:none X-HE-Tag: rod76_23ae7e2a51b36 X-Filterd-Recvd-Size: 3556 Date: Fri, 18 Mar 2016 10:27:23 -0400 From: Steven Rostedt To: Jiri Olsa Cc: lkml , Ingo Molnar , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: Re: [PATCH 5/5] ftrace: Update dynamic ftrace calls only if necessary Message-ID: <20160318102723.671fd983@gandalf.local.home> In-Reply-To: <1458138873-1553-6-git-send-email-jolsa@kernel.org> References: <1458138873-1553-1-git-send-email-jolsa@kernel.org> <1458138873-1553-6-git-send-email-jolsa@kernel.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; 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 Patches 4 and 5 seem agnostic to patches 1-3. I'll pull 4,5 into my tree and 1-3 can go though tip. I'd like to run theses through my tests. OK? -- Steve On Wed, 16 Mar 2016 15:34:33 +0100 Jiri Olsa wrote: > Currently dynamic ftrace calls are updated any time > the ftrace_ops is un/registered. If we do this update > only when it's needed, we save lot of time for perf > system wide ftrace function sampling/counting. > > The reason is that for system wide sampling/counting, > perf creates event for each cpu in the system. > > Each event then registers separate copy of ftrace_ops, > which ends up in FTRACE_UPDATE_CALLS updates. On servers > with many cpus that means serious stall (240 cpus server): > > Counting: > # time ./perf stat -e ftrace:function -a sleep 1 > > Performance counter stats for 'system wide': > > 370,663 ftrace:function > > 1.401427505 seconds time elapsed > > real 3m51.743s > user 0m0.023s > sys 3m48.569s > > Sampling: > # time ./perf record -e ftrace:function -a sleep 1 > [ perf record: Woken up 0 times to write data ] > Warning: > Processed 141200 events and lost 5 chunks! > > [ perf record: Captured and wrote 10.703 MB perf.data (135950 samples) ] > > real 2m31.429s > user 0m0.213s > sys 2m29.494s > > There's no reason to do the FTRACE_UPDATE_CALLS update > for each event in perf case, because all the ftrace_ops > always share the same filter, so the updated calls are > always the same. > > It's required that only first ftrace_ops registration > does the FTRACE_UPDATE_CALLS update (also sometimes > the second if the first one used the trampoline), but > the rest can be only cheaply linked into the ftrace_ops > list. > > Counting: > # time ./perf stat -e ftrace:function -a sleep 1 > > Performance counter stats for 'system wide': > > 398,571 ftrace:function > > 1.377503733 seconds time elapsed > > real 0m2.787s > user 0m0.005s > sys 0m1.883s > > Sampling: > # time ./perf record -e ftrace:function -a sleep 1 > [ perf record: Woken up 0 times to write data ] > Warning: > Processed 261730 events and lost 9 chunks! > > [ perf record: Captured and wrote 19.907 MB perf.data (256293 samples) ] > > real 1m31.948s > user 0m0.309s > sys 1m32.051s > > Signed-off-by: Jiri Olsa > ---