From: sjg@chromium.org (Simon Glass)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 2/3] bootstage: Insert bootstage_mark to record timing for bootup.
Date: Fri, 23 Sep 2011 16:03:17 -0700 [thread overview]
Message-ID: <1316818998-30711-3-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1316818998-30711-1-git-send-email-sjg@chromium.org>
From: Da Zheng <zhengda@chromium.org>
From: Da Zheng <zhengda@chromium.org>
This inserts calls to bootstage_mark() to timestamp the kernel moving
between the different initcall levels.
Signed-off-by: Da Zheng <zhengda@chromium.com>
---
init/bootstage.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
init/main.c | 7 +++++++
2 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/init/bootstage.c b/init/bootstage.c
index 79e9761..6f4668f 100644
--- a/init/bootstage.c
+++ b/init/bootstage.c
@@ -226,3 +226,52 @@ static int __init bootstage_init(void)
}
postcore_initcall(bootstage_init);
+
+static int __init post_core_initcall(void)
+{
+ bootstage_mark("core_initcall");
+ return 0;
+}
+core_initcall_sync(post_core_initcall);
+
+static int __init post_postcore_initcall(void)
+{
+ bootstage_mark("postcore_initcall");
+ return 0;
+}
+postcore_initcall_sync(post_postcore_initcall);
+
+static int __init post_arch_initcall(void)
+{
+ bootstage_mark("arch_initcall");
+ return 0;
+}
+arch_initcall_sync(post_arch_initcall);
+
+static int __init post_subsys_initcall(void)
+{
+ bootstage_mark("subsys_initcall");
+ return 0;
+}
+subsys_initcall_sync(post_subsys_initcall);
+
+static int __init post_fs_initcall(void)
+{
+ bootstage_mark("fs_initcall");
+ return 0;
+}
+fs_initcall_sync(post_fs_initcall);
+
+static int __init post_device_initcall(void)
+{
+ bootstage_mark("device_initcall");
+ return 0;
+}
+device_initcall_sync(post_device_initcall);
+
+static int __init post_late_initcall(void)
+{
+ bootstage_mark("late_initcall");
+ return 0;
+}
+late_initcall_sync(post_late_initcall);
diff --git a/init/main.c b/init/main.c
index 9c51ee7..671d6b7 100644
--- a/init/main.c
+++ b/init/main.c
@@ -75,6 +75,8 @@
#include <asm/sections.h>
#include <asm/cacheflush.h>
+#include <linux/bootstage.h>
+
#ifdef CONFIG_X86_LOCAL_APIC
#include <asm/smp.h>
#endif
@@ -489,6 +491,7 @@ asmlinkage void __init start_kernel(void)
page_address_init();
printk(KERN_NOTICE "%s", linux_banner);
setup_arch(&command_line);
+ bootstage_mark_early("bootstage_start");
mm_init_owner(&init_mm, &init_task);
mm_init_cpumask(&init_mm);
setup_command_line(command_line);
@@ -627,6 +630,7 @@ asmlinkage void __init start_kernel(void)
sfi_init_late();
ftrace_init();
+ bootstage_mark("before_rest_init");
/* Do the rest non-__init'ed, we're now alive */
rest_init();
@@ -722,6 +726,7 @@ static void __init do_basic_setup(void)
driver_init();
init_irq_proc();
do_ctors();
+ bootstage_mark("before_initcalls");
do_initcalls();
}
@@ -806,6 +811,7 @@ static int __init kernel_init(void * unused)
sched_init_smp();
do_basic_setup();
+ bootstage_mark("after_basic_setup");
/* Open the /dev/console on the rootfs, this should never fail */
if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
@@ -832,6 +838,7 @@ static int __init kernel_init(void * unused)
* initmem segments and start the user-mode stuff..
*/
+ bootstage_mark("before_init_post");
init_post();
return 0;
}
--
1.7.3.1
next prev parent reply other threads:[~2011-09-23 23:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-23 23:03 [RFC PATCH 0/3] Add accurate boot timing to a Linux system Simon Glass
2011-09-23 23:03 ` [RFC PATCH 1/3] bootstage: Add bootstages to record timing in the kernel Simon Glass
2011-09-23 23:03 ` Simon Glass [this message]
2011-09-25 12:59 ` [RFC PATCH 2/3] bootstage: Insert bootstage_mark to record timing for bootup Bjorn Helgaas
2011-09-23 23:03 ` [RFC PATCH 3/3] bootstage: Get u-boot timing from the device tree Simon Glass
2011-09-23 23:34 ` [RFC PATCH 0/3] Add accurate boot timing to a Linux system Valdis.Kletnieks at vt.edu
2011-09-24 4:10 ` Simon Glass
2011-09-24 8:32 ` Russell King - ARM Linux
2011-09-24 14:06 ` Simon Glass
2011-09-26 7:53 ` Matthieu CASTET
2011-09-27 18:29 ` Simon Glass
2011-09-25 12:54 ` Bjorn Helgaas
2011-09-27 18:26 ` Simon Glass
2011-09-27 17:56 ` Tim Bird
2011-09-27 17:57 ` Tim Bird
2011-09-27 18:42 ` Simon Glass
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=1316818998-30711-3-git-send-email-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).