Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbdCaGVE (ORCPT ); Fri, 31 Mar 2017 02:21:04 -0400 Received: from mail-qt0-f173.google.com ([209.85.216.173]:36180 "EHLO mail-qt0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751291AbdCaGVD (ORCPT ); Fri, 31 Mar 2017 02:21:03 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Zong Li Date: Fri, 31 Mar 2017 14:21:01 +0800 Message-ID: Subject: Re: Ftrace: Static function graph not work To: linux-kernel@vger.kernel.org Cc: rostedt@goodmis.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1795 Lines: 60 ping 2017-03-23 11:28 GMT+08:00 Zong Li : > Hi all, > > I test the static function graph for ARM, x86 and x86_64 architecture > on linux-3.10 and linux-4.9, and I find it works correctly only for > x86_64 on linux-4.9. > > After the following commit, the function tracer also be registered > when registering the function graph tracer. > > commit 2940c25bec92f40a3f7f32504b8ea115d1701892 > Author: Steven Rostedt (Red Hat) > CommitDate: Wed Dec 4 10:57:05 2013 -0800 > > ftrace: Fix function graph with loading of modules > > > The arch-depend code implement the mcount function pseudo code like: > > void mcount(void) > { > ... > if (ftrace_trace_function != ftrace_stub) > goto do_trace; > > #ifdef CONFIG_FUNCTION_GRAPH_TRACER > if (ftrace_graph_return != ftrace_stub || > ftrace_graph_entry != ftrace_graph_entry_stub) > ftrace_graph_caller(); > #endif > return; > > do_trace: > ... > } > > The function pointer 'ftrace_trace_function' will not be 'ftrace_stub' > because function tracer is registered too, so the function graph part > will not be executed. > > > On the other hand, I find the another patch to resolve this situation, > and it is reason that x86_64 architecture can work correctly. > > commit 62a207d748dd9224140a634786b274fdb6ece0b9 > Author: Steven Rostedt (Red Hat) > CommitDate: Mon Nov 24 15:02:25 2014 -0500 > > ftrace/x86: Have static function tracing always test for function graph > > > so, is this problem tending to handle by each architecture? or maybe > it is need to solve by generic code? > > > This is my first mail to mailing list, please excuse having mistake > and let me know. > Thank a lot !