linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zong Li <zongbox@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Ftrace: Static function graph not work
Date: Thu, 23 Mar 2017 11:28:03 +0800	[thread overview]
Message-ID: <CA+ZOyah8=jvB2MAE3FppuVTQe4QwUEonsd=nR4Hz6sC+L=4sbg@mail.gmail.com> (raw)

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) <rostedt@goodmis.org>
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) <rostedt@goodmis.org>
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 !

             reply	other threads:[~2017-03-23  3:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23  3:28 Zong Li [this message]
2017-03-31  6:21 ` Ftrace: Static function graph not work Zong Li
2017-03-31  6:31 ` Zong Li
2017-03-31 13:42 ` Steven Rostedt
2017-04-04  9:31   ` Zong Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+ZOyah8=jvB2MAE3FppuVTQe4QwUEonsd=nR4Hz6sC+L=4sbg@mail.gmail.com' \
    --to=zongbox@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).