summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2009-05-14 09:41:06 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2009-05-14 09:41:06 +0000
commitfbca29bf12e71679ccbf17b1566a541be2c4d025 (patch)
tree24ad808a20e513b4a769e29a0709738fae0814e6 /generic
parent40205fb63a2bb4b1c081632e4ef25c8b580fd231 (diff)
downloadptxdist-fbca29bf12e71679ccbf17b1566a541be2c4d025.tar.gz
ptxdist-fbca29bf12e71679ccbf17b1566a541be2c4d025.tar.xz
[bootchart] added c-based bootchart tool from ubuntu
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@10519 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'generic')
-rw-r--r--generic/sbin/bootchartd48
1 files changed, 48 insertions, 0 deletions
diff --git a/generic/sbin/bootchartd b/generic/sbin/bootchartd
new file mode 100644
index 000000000..41b868510
--- /dev/null
+++ b/generic/sbin/bootchartd
@@ -0,0 +1,48 @@
+#!/bin/sh
+#
+# Bootchart logger script
+#
+# Copyright (C) 2009 by Marc Kleine-Budde <mkl@pengutronix.de>
+#
+# based on: Bootchart logger script from
+#
+# Ziga Mahkovec <ziga.mahkovec@klika.si>
+#
+# This script is used for data collection for the bootchart boot
+# performance visualization tool (http://www.bootchart.org).
+#
+# To profile the boot process, bootchartd should be called instead of
+# /sbin/init. Modify the kernel command line to include
+# init=/sbin/bootchartd or rdinit=/sbin/bootchartd if you use an
+# initrd
+#
+# bootchartd will then start itself in background and exec /sbin/init
+# or /init in case of an inird (or an alternative init process if
+# specified using bootchart_init=)
+#
+
+PATH="/sbin:/bin:/usr/sbin:/usr/bin"
+VERSION="0.9"
+
+LOG_DIR="/bc"
+OUT_DIR="/var/log"
+HZ=10
+
+mount proc /proc -t proc
+
+{
+ mount -n -t tmpfs -o size=8M none "$LOG_DIR"
+ /lib/bootchart/collector ${HZ} "${LOG_DIR}"
+ /lib/bootchart/gather "${OUT_DIR}/bootchart.tgz" "${LOG_DIR}"
+} &
+
+# from kernel:/init/main.c
+for init in \
+ "/sbin/init" \
+ "/etc/init" \
+ "/bin/init" \
+ "/bin/sh"; do
+ if [ -x "$init" ]; then
+ exec "${init}" "$@"
+ fi
+done