aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2008-10-28 15:17:38 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-28 14:15:58 -0400
commit0b6e4d56bf71866a2b58daa8323cf747988ce7e4 (patch)
treeabda53ec941c887283d496abf5d364ba80f72d5e /kernel/trace/ftrace.c
parente946217e4fdaa67681bbabfa8e6b18641921f750 (diff)
ftrace: perform an initialization for ftrace to enable it
Impact: corrects a bug which made the non-dyn function tracer not functional With latest git, the non-dynamic 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 <fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 7618c528756b..4a39d24568c8 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1339,6 +1339,14 @@ void __init ftrace_init(void)
1339} 1339}
1340 1340
1341#else 1341#else
1342
1343static int __init ftrace_nodyn_init(void)
1344{
1345 ftrace_enabled = 1;
1346 return 0;
1347}
1348device_initcall(ftrace_nodyn_init);
1349
1342# define ftrace_startup() do { } while (0) 1350# define ftrace_startup() do { } while (0)
1343# define ftrace_shutdown() do { } while (0) 1351# define ftrace_shutdown() do { } while (0)
1344# define ftrace_startup_sysctl() do { } while (0) 1352# define ftrace_startup_sysctl() do { } while (0)