All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Frédéric Weisbecker" <fweisbec@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Steven Rostedt <rostedt@goodmis.org>,
	Steven Noonan <steven@uplinklabs.net>,
	Arjan van de Ven <arjan@infradead.org>
Subject: [Patch -tip 4/4] Tracing/ftrace: Launch initcall tracing after pre-smp initcalls.
Date: Tue, 23 Sep 2008 11:38:18 +0100	[thread overview]
Message-ID: <48D8C71A.7080204@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

Launch the initcall tracing inside the initcall_debug area. Old printk have not been
removed to keep the old way of initcall tracing for backward compatibility.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---

[-- Attachment #2: patch4.diff --]
[-- Type: text/plain, Size: 1051 bytes --]

diff --git a/init/main.c b/init/main.c
index a9e36fb..a90d4f5 100644
--- a/init/main.c
+++ b/init/main.c
@@ -724,9 +724,12 @@ int do_one_initcall(initcall_t fn)
 	ktime_t t0, t1, delta;
 	char msgbuf[64];
 	int result;
+	struct initcall_trace it;
 
 	if (initcall_debug) {
-		printk("calling  %pF @ %i\n", fn, task_pid_nr(current));
+		it.caller = task_pid_nr(current);
+		it.func = fn;
+		printk("calling  %pF @ %i\n", fn, it.caller);
 		t0 = ktime_get();
 	}
 
@@ -735,9 +738,11 @@ int do_one_initcall(initcall_t fn)
 	if (initcall_debug) {
 		t1 = ktime_get();
 		delta = ktime_sub(t1, t0);
-
+		it.result = result;
+		it.duration = (unsigned long long) delta.tv64 >> 20;
 		printk("initcall %pF returned %d after %Ld msecs\n", fn,
-			result, (unsigned long long) delta.tv64 >> 20);
+			result, it.duration);
+		trace_initcall(&it);
 	}
 
 	msgbuf[0] = 0;
@@ -947,6 +952,7 @@ static int __init kernel_init(void * unused)
 	smp_prepare_cpus(setup_max_cpus);
 
 	do_pre_smp_initcalls();
+	start_initcall_trace();
 
 	smp_init();
 	sched_init_smp();

                 reply	other threads:[~2008-09-23  9:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=48D8C71A.7080204@gmail.com \
    --to=fweisbec@gmail.com \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=steven@uplinklabs.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.