Skip to contentSkip to conversation

Tracing/ftrace: Make tracing suitable to run the initcall tracer

PATCH In review Frédéric Weisbecker 1 participant 1 message Sep 23, 2008 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 Tracing/ftrace: Make tracing suitable to run the initcall tracer

The tracing engine have now to be init in early_initcall to set the initcall tracer. Only the debugfs settings will be initialized at fs_initcall time.

---

kernel/trace/trace.c +10 -5
index f2ef72f..16f1409 100644
@@ -2990,7 +2990,7 @@ struct dentry *tracing_init_dentry(void)
 #include "trace_selftest.c"
 #endif
 
-static __init void tracer_init_debugfs(void)
+static __init int tracer_init_debugfs(void)
 {
 	struct dentry *d_tracer;
 	struct dentry *entry;
@@ -3078,6 +3078,7 @@ static __init void tracer_init_debugfs(void)
 #ifdef CONFIG_SYSPROF_TRACER
 	init_tracer_sysprof_debugfs(d_tracer);
 #endif
+	return 0;
 }
 
 int trace_vprintk(unsigned long ip, const char *fmt, va_list args)
@@ -3504,12 +3505,16 @@ __init static int tracer_alloc_buffers(void)
 		pages, trace_nr_entries, (long)TRACE_ENTRY_SIZE);
 	pr_info("   actual entries %ld\n", global_trace.entries);
 
-	tracer_init_debugfs();
-
 	trace_init_cmdlines();
 
 	register_tracer(&nop_trace);
+#ifdef CONFIG_INITCALL_TRACER
+	register_tracer(&initcall_tracer);
+	current_trace = &initcall_tracer;
+	current_trace->init(&global_trace);
+#else
 	current_trace = &nop_trace;
+#endif
 
 	/* All seems OK, enable tracing */
 	global_trace.ctrl = tracer_enabled;
@@ -3519,7 +3524,6 @@ __init static int tracer_alloc_buffers(void)
 				       &trace_panic_notifier);
 
 	register_die_notifier(&trace_die_notifier);
-
 	return 0;
 
  free_buffers:
@@ -3548,4 +3552,5 @@ __init static int tracer_alloc_buffers(void)
 	}
 	return ret;
 }
-fs_initcall(tracer_alloc_buffers);
+early_initcall(tracer_alloc_buffers);
+fs_initcall(tracer_init_debugfs);