Re: [PATCH] fastboot: Add a script to visualize the kernel boot process / time

Previous thread: [PATCH 1/4] ext3: Fix ext3_dx_readdir hash collision handling by Theodore Ts'o on Saturday, September 13, 2008 - 8:32 am. (13 messages)

Next thread: Re: PCI: Add ALI M5229 comaptibility mode quirk by Robert Hancock on Saturday, September 13, 2008 - 10:31 am. (1 message)
From: Arjan van de Ven
Date: Saturday, September 13, 2008 - 9:42 am

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 ...
From: Ingo Molnar
Date: Sunday, September 14, 2008 - 6:18 am

applied to tip/fastboot - thanks Arjan.

	Ingo
--

From: Pádraig Brady
Date: Monday, September 15, 2008 - 5:59 am

Have you example output anywhere?

--

From: Arjan van de Ven
Date: Monday, September 15, 2008 - 6:37 am

On Mon, 15 Sep 2008 13:59:49 +0100

eh sure

http://www.fenrus.org/before.svg
http://www.fenrus.org/after.svg

(before and after another patch ;-)



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
--

From: Pádraig Brady
Date: Monday, September 15, 2008 - 7:27 am

Nice times :)
I guess we'll hear more about this on Thursday morning:
http://linuxplumbersconf.org/program/speakers/getspeaker.php?speaker=avandeven.txt

Pádraig.
--

From: Pádraig Brady
Date: Thursday, October 2, 2008 - 4:43 am

For the archives, there is some public info on this now:
http://lwn.net/Articles/299483/

cheers,
Pádraig.
--

Previous thread: [PATCH 1/4] ext3: Fix ext3_dx_readdir hash collision handling by Theodore Ts'o on Saturday, September 13, 2008 - 8:32 am. (13 messages)

Next thread: Re: PCI: Add ALI M5229 comaptibility mode quirk by Robert Hancock on Saturday, September 13, 2008 - 10:31 am. (1 message)