LKML Archive on
help / color / mirror / Atom feed
From: Frederic Weisbecker <>
To: Ingo Molnar <>
Cc: Steven Rostedt <>,
Subject: [PATCH] ftrace: perform an initialization for ftrace to enable it
Date: Tue, 28 Oct 2008 20:17:38 +0100	[thread overview]
Message-ID: <> (raw)

Impact: Corrects a bug which made the function tracer not functionnal

With latest git, the function tracer didn't get any trace.
The problem was the fact that ftrace_enabled wasn't
initialized to 1 because ftrace hasn't any init function when DYNAMIC_FTRACE
is disabled.
So when a tracer tries to register an ftrace_ops struct, 
__register_ftrace_function failed to set the hook.

This patch corrects it by setting an init function to initialize
ftrace during the boot.

Signed-off-by: Frederic Weisbecker <>
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 7618c52..4a39d24 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1339,6 +1339,14 @@ void __init ftrace_init(void)
+static int __init ftrace_nodyn_init(void)
+	ftrace_enabled = 1;
+	return 0;
 # define ftrace_startup()		do { } while (0)
 # define ftrace_shutdown()		do { } while (0)
 # define ftrace_startup_sysctl()	do { } while (0)

             reply	other threads:[~2008-10-28 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28 19:17 Frederic Weisbecker [this message]
2008-10-28 18:16 ` Ingo Molnar

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:

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

  git send-email \ \ \ \ \ \
    --subject='Re: [PATCH] ftrace: perform an initialization for ftrace to enable it' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).