mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Todd Brandt <todd.e.brandt@linux.intel.com>
Subject: [RFC][PATCH 1/4] tracing: Split tracing initialization into two for early initialization
Date: Tue, 07 Mar 2017 16:28:34 -0500	[thread overview]
Message-ID: <20170307212943.135744008@goodmis.org> (raw)
In-Reply-To: <20170307212833.964734229@goodmis.org>

[-- Attachment #1: 0001-tracing-Split-tracing-initialization-into-two-for-ea.patch --]
[-- Type: text/plain, Size: 2131 bytes --]

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 b0c9d6facef9..0d6cc6661f2b 100644
--- a/init/main.c
+++ b/init/main.c
@@ -539,6 +539,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()
@@ -564,7 +567,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 54e3b8711aca..c4c21de61145 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

  reply	other threads:[~2017-03-08  0:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07 21:28 [RFC][PATCH 0/4] tracing: Allow function tracing to start earlier in boot up Steven Rostedt
2017-03-07 21:28 ` Steven Rostedt [this message]
2017-03-07 21:28 ` [RFC][PATCH 2/4] ftrace: Move ftrace_init() to right after memory initialization Steven Rostedt
2017-03-07 21:28 ` [RFC][PATCH 3/4] ftrace: Have function tracing start in early boot up Steven Rostedt
2017-03-07 21:28 ` [RFC][PATCH 4/4] ftrace: Allow for function tracing to record init functions on " Steven Rostedt
2017-03-08 20:07   ` Steven Rostedt
2017-03-08 19:15 ` [RFC][PATCH 0/4] tracing: Allow function tracing to start earlier in " Todd Brandt
2017-03-08 19:32   ` Todd Brandt
2017-03-08 19:36     ` Steven Rostedt

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=20170307212943.135744008@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=todd.e.brandt@linux.intel.com \
    /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

Powered by JetHome