Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1611413

[for-next][PATCH 1/7] tracing: Split tracing initialization into two for early initialization

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject [for-next][PATCH 1/7] tracing: Split tracing initialization into two for early initialization
Date 2017-03-29 00:20 +0200
Message-ID <tq7D4-5Qj-21@gated-at.bofh.it> (permalink)
References <tq7D3-5Qj-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

Create an early_trace_init() function that will initialize the buffers and
allow for ealier use of trace_printk(). This will also allow for future work
to have function tracing start earlier at boot up.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/linux/ftrace.h | 2 ++
 init/main.c            | 5 ++++-
 kernel/trace/trace.c   | 6 +++++-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 3633e8beff39..569db5589851 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -42,8 +42,10 @@
 /* Main tracing buffer and events set up */
 #ifdef CONFIG_TRACING
 void trace_init(void);
+void early_trace_init(void);
 #else
 static inline void trace_init(void) { }
+static inline void early_trace_init(void) { }
 #endif
 
 struct module;
diff --git a/init/main.c b/init/main.c
index f9c9d9948203..81a49e8d54cc 100644
--- a/init/main.c
+++ b/init/main.c
@@ -545,6 +545,9 @@ asmlinkage __visible void __init start_kernel(void)
 	trap_init();
 	mm_init();
 
+	/* trace_printk can be enabled here */
+	early_trace_init();
+
 	/*
 	 * Set up the scheduler prior starting any interrupts (such as the
 	 * timer interrupt). Full topology setup happens at smp_init()
@@ -570,7 +573,7 @@ asmlinkage __visible void __init start_kernel(void)
 
 	rcu_init();
 
-	/* trace_printk() and trace points may be used after this */
+	/* Trace events are available after this */
 	trace_init();
 
 	context_tracking_init();
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f35109514a01..6757561d9617 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -7999,7 +7999,7 @@ __init static int tracer_alloc_buffers(void)
 	return ret;
 }
 
-void __init trace_init(void)
+void __init early_trace_init(void)
 {
 	if (tracepoint_printk) {
 		tracepoint_print_iter =
@@ -8010,6 +8010,10 @@ void __init trace_init(void)
 			static_key_enable(&tracepoint_printk_key.key);
 	}
 	tracer_alloc_buffers();
+}
+
+void __init trace_init(void)
+{
 	trace_event_init();
 }
 
-- 
2.10.2

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[for-next][PATCH 0/7] tracing: [4.12] Allow function tracing to start earlier in boot up Steven Rostedt <rostedt@goodmis.org> - 2017-03-29 00:20 +0200
  [for-next][PATCH 6/7] tracing: Move trace_handle_return() out of line Steven Rostedt <rostedt@goodmis.org> - 2017-03-29 00:20 +0200
  [for-next][PATCH 5/7] ftrace: Allow for function tracing to record init functions on boot  up Steven Rostedt <rostedt@goodmis.org> - 2017-03-29 00:20 +0200
  [for-next][PATCH 7/7] ftrace/x86: Do no run CPU sync when there is only one CPU online Steven Rostedt <rostedt@goodmis.org> - 2017-03-29 00:20 +0200
  [for-next][PATCH 2/7] ftrace: Move ftrace_init() to right after memory initialization Steven Rostedt <rostedt@goodmis.org> - 2017-03-29 00:20 +0200
  [for-next][PATCH 3/7] tracing: Postpone tracer start-up tests till the system is more  robust Steven Rostedt <rostedt@goodmis.org> - 2017-03-29 00:20 +0200
  [for-next][PATCH 1/7] tracing: Split tracing initialization into two for early  initialization Steven Rostedt <rostedt@goodmis.org> - 2017-03-29 00:20 +0200
  [for-next][PATCH 4/7] ftrace: Have function tracing start in early boot up Steven Rostedt <rostedt@goodmis.org> - 2017-03-29 00:20 +0200

csiph-web