From fbca29bf12e71679ccbf17b1566a541be2c4d025 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Thu, 14 May 2009 09:41:06 +0000 Subject: [bootchart] added c-based bootchart tool from ubuntu Signed-off-by: Marc Kleine-Budde git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@10519 33e552b5-05e3-0310-8538-816dae2090ed --- generic/sbin/bootchartd | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 generic/sbin/bootchartd (limited to 'generic') 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 +# +# based on: Bootchart logger script from +# +# Ziga Mahkovec +# +# 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 -- cgit v1.2.3