From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932246AbdJZKvd (ORCPT ); Thu, 26 Oct 2017 06:51:33 -0400 Received: from smtprelay0182.hostedemail.com ([216.40.44.182]:54049 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932141AbdJZKvc (ORCPT ); Thu, 26 Oct 2017 06:51:32 -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:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2895:2898:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3874:4184:4362:5007:6119:6261:7875:7903:8660:9040:9707:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12663:12740:12760:12895:13069:13148:13230:13255:13311:13357:13439:14096:14097:14180:14181:14659:14721:21060:21067:21080:21627:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: sheep63_d295903f0e4d X-Filterd-Recvd-Size: 2501 Date: Thu, 26 Oct 2017 06:51:25 -0400 From: Steven Rostedt To: Julien Thierry Cc: "linux-arm-kernel@lists.infradead.org" , LKML , AKASHI Takahiro Subject: Re: arm64: ftrace: function_graph tracer not working without dynamic instrumentation Message-ID: <20171026065125.7fa3d25e@vmware.local.home> In-Reply-To: References: X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; 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 Thu, 26 Oct 2017 09:50:13 +0100 Julien Thierry wrote: > Hi, > > On arm64, I noticed that when CONFIG_DYNAMIC_FTRACE is not enabled, > using the function_graph tracer in ftrace alway gives empty traces. > > The issues seems to be that the ftrace_trace_function is set to a > function different than ftrace_stub when running mcount. If I allow > mcount to continue beyond that check, I get the graph traces. > > Guidelines given in Documentation/trace/ftrace-design.txt suggest that Heh, I haven't looked at that document since I reviewed it. > ftrace_trace_function != ftrace_stub should be checked before any > function_graph related values and if the check is true then we shouldn't > try to call ftrace_trace_function. > > Investigating a bit more, ftrace_trace_function gets set > ftrace_ops_no_ops in update_ftrace_function called when setting up the > function_graph tracer. > > The issue does not occur when dynamic ftrace is supported because we > just replace some nops at known locations and replace them with branches. > > It seemed to me that the arm64 side of things is following the > guidelines in ftrace-design, so I am unsure whether it is intended that > the ftrace_trace_function is not set to ftrace_stub when using the > function_graph tracer. With all honesty, I didn't look at the "static" part too much. Yeah, what's in the document is wrong. Just follow what x86 does. I'll have to make a note to myself to update that document. Thanks! -- Steve