From: Arjan van de Ven <arjan@linux.intel.com>
Subject: [PATCH] fastboot: Add a script to visualize the kernel boot process / time
When optimizing the kernel boot time, it's very valuable to visualize
what is going on at which time. In addition, with the fastboot asynchronous
initcall level, it's very valuable to see which initcall gets run where
and when.
This patch adds a script to turn a dmesg into a SVG graph (that can be
shown with tools such as InkScape, Gimp or Firefox) and a small change
to the initcall code to print the PID of the thread calling the initcall
(so that the script can work out the parallelism).
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
init/main.c | 3 +-
scripts/bootgraph.pl | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 134 insertions(+), 1 deletions(-)
create mode 100644 scripts/bootgraph.pl
diff --git a/init/main.c b/init/main.c
index 73785a4..d74757c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -702,7 +702,8 @@ int do_one_initcall(initcall_t fn)
int result;
if (initcall_debug) {
- print_fn_descriptor_symbol("calling %s\n", fn);
+ print_fn_descriptor_symbol("calling %s", fn);
+ printk(" @ %i\n", task_pid_nr(current));
t0 = ktime_get();
}
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl
new file mode 100644
index 0000000..54907d6
--- /dev/null
+++ b/scripts/bootgraph.pl
@@ -0,0 +1,132 @@
+#!/usr/bin/perl
+
+# Copyright 2007, Intel Corporation
+#
+# This file is part of the Linux kernel
+#
+# This program file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more ...