summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/bootchart2
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/bootchart2')
-rw-r--r--meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh18
-rw-r--r--meta/recipes-devtools/bootchart2/bootchart2_git.bb148
2 files changed, 166 insertions, 0 deletions
diff --git a/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh b/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh
new file mode 100644
index 0000000000..21a78877a2
--- /dev/null
+++ b/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh
@@ -0,0 +1,18 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: bootchartd_stop
4# Required-Start: $remote_fs $all
5# Required-Stop:
6# Default-Start: 2 3 4 5
7# Default-Stop:
8# Short-Description: Stop bootchartd collection
9# Description: This script accompanies bootchartd from bootchart2.
10# bootchartd should stop detect the end of the boot process
11# automatically if a window manager is launched, but for
12# command-line only operating systems, this script should be
13# used instead.
14### END INIT INFO
15
16/sbin/bootchartd stop
17
18: exit 0
diff --git a/meta/recipes-devtools/bootchart2/bootchart2_git.bb b/meta/recipes-devtools/bootchart2/bootchart2_git.bb
new file mode 100644
index 0000000000..e5838524ed
--- /dev/null
+++ b/meta/recipes-devtools/bootchart2/bootchart2_git.bb
@@ -0,0 +1,148 @@
1# Copyright (c) 2013 LG Electronics, Inc.
2# Copyright (C) 2014 Intel Corp.
3
4# This recipe creates packages for the bootchart2 system-wide profiler daemon
5# and related utilities. Depending on the images you're building, additional
6# configuration may be needed in order to use it.
7#
8# Packages:
9# * bootchart2 - The daemon itself.
10# * pybootchartgui - Python program to visualize and display the data
11# collected by bootchart2 or compatible daemons such as the original
12# bootchart.
13# * bootchartd-stop-initscript - A SysV init script to stop data collection
14# when booting completes (see below for details.)
15#
16# While bootchart2 is designed to stop collecting data roughly when the boot
17# process completes, it is not exactly a stopwatch. It has a list of programs
18# which are supposed signify that the boot process has completed (for example,
19# openbox or gnome-shell,) but it waits a full 20 seconds after such a program
20# is launched before stopping itself, to collect additional data.
21#
22# If you are using a window manager or GUI which isn't included in bootchart2's
23# default configuration file, you should write bbappend file to amend
24# bootchartd.conf and add it to EXIT_PROC. An example of this is shown in this
25# recipe, where the Matchbox window manager (used by Sato) is added.
26#
27# If you want data collection to end at a certain point exactly, you should
28# arrange for the following command to be run:
29# bootchartd stop
30# You might set this command to be launched by the desktop environment shipped
31# on the image you're building after the other startup programs are complete.
32# This will not incur the 20 second wait period and will cause bootchart2 to
33# behave a bit more like a stopwatch. An example of this is shown in this
34# recipe, specifically the bootchartd-stop-initscript package, which stops data
35# collection as the last action when switching to runlevels 2 through 5. You can
36# add bootchartd-stop-initscript to IMAGE_INSTALL if you need to use it.
37#
38# Unless you're doing something special, if your image does not launch an X
39# window manager, you will need to add bootchartd-stop-initscript to your image.
40#
41# Bootchart2 can be started in two ways. Data collection can be initiated by
42# running the following command:
43# bootchartd start
44# However, for the most complete data, the bootchart2 developers recommend
45# running it as PID 1. This can be done by adding the following to the kernel
46# command line parameters in the bootloader setup:
47# init=/sbin/bootchartd
48# When invoked this way, bootchart2 will set itself up and then automatically
49# run /sbin/init. For example, when booting the default qemux86 image, one might
50# use a command like this:
51# runqemu qemux86 bootparams="initcall_debug printk.time=y quiet \
52# init=/sbin/bootchartd"
53#
54# Neither method is actually implemented here, choose what works for you.
55#
56# If you are building your image with systemd instead of SysV init, bootchart2
57# includes systemd service files to begin collection automatically at boot and
58# end collection automatically 20 seconds after the boot process has completed.
59# However, be aware that systemd tends to start bootchart2 relatively late into
60# the boot process, so it's highly recommended to use bootchart2 as PID 1. If
61# you're using systemd and you wish to use another method to stop data
62# collection at a time of your choosing, you may do so as long as you get to it
63# before the 20 second timeout of the systemd service files. Also, you may write
64# a bbappend to patch bootchart2-done.timer.in to increase or decrease the
65# timeout. Decreasing it to 0 will make it behave like
66# bootchartd-stop-initscript.
67#
68# By default, when data collection is stopped, a file named bootchart.tgz will
69# be created in /var/log. If pybootchartgui is included in your image,
70# bootchart.png will also be created at the same time. However, this results in
71# a noticeable hitch or pause at boot time, which may not be what you want on an
72# embedded device. So you may prefer to omit pybootchartgui from your image. In
73# that case, copy bootchart.tgz over to your development system and generate
74# bootchart.png there. To get pybootchartgui on your development system, you can
75# either install it directly from some other source, or build bootchart2-native
76# and find pybootchartgui in the native sysroot:
77# bitbake bootchart2-native
78# ./tmp/sysroots/x86_64-linux/usr/bin/pybootchartgui /path/to/bootchart.tgz
79# Note that, whether installed on your build system or on your image, the
80# pybootchartgui provided by this recipe does not support the -i option. You
81# will need to install pybootchartgui by other means in order to run it in
82# interactive mode.
83
84SUMMARY = "Booting sequence and CPU,I/O usage monitor"
85DESCRIPTION = "Monitors where the system spends its time at start, creating a graph of all processes, disk utilization, and wait time."
86AUTHOR = "Wonhong Kwon <wonhong.kwon@lge.com>"
87HOMEPAGE = "https://github.com/mmeeks/bootchart"
88LICENSE = "GPL-3.0"
89LIC_FILES_CHKSUM = "file://COPYING;md5=44ac4678311254db62edf8fd39cb8124"
90
91# one commit beyond 1.14.6 for a systemd-related bugfix
92PV = "0.14.6+git${SRCPV}"
93
94SRC_URI = "git://github.com/mmeeks/bootchart.git"
95SRC_URI += "file://bootchartd_stop.sh"
96
97SRCREV = "b65ed43b0ae832080fb728245de9ef1a4b48d8b5"
98
99S = "${WORKDIR}/git"
100
101inherit systemd
102inherit update-rc.d
103inherit pythonnative
104
105# The only reason to build bootchart2-native is for a native pybootchartgui.
106BBCLASSEXTEND = "native"
107
108SYSTEMD_SERVICE_${PN} = "bootchart2.service bootchart2-done.service bootchart2-done.timer"
109
110UPDATERCPN = "bootchartd-stop-initscript"
111INITSCRIPT_NAME = "bootchartd_stop.sh"
112INITSCRIPT_PARAMS = "start 99 2 3 4 5 ."
113
114# We want native pybootchartgui to execute with the correct Python interpeter.
115do_compile_append_class-native () {
116 echo "#! ${PYTHON}" | cat - ${S}/pybootchartgui.py > ${WORKDIR}/temp_pybootchartgui
117 mv ${WORKDIR}/temp_pybootchartgui ${S}/pybootchartgui.py
118 chmod +x ${S}/pybootchartgui
119}
120
121do_install () {
122 install -d ${D}${sysconfdir} # needed for -native
123 export PY_LIBDIR="${libdir}/${PYTHON_DIR}"
124 export BINDIR="${bindir}"
125 export DESTDIR="${D}"
126
127 oe_runmake install
128 install -d ${D}${sysconfdir}/init.d
129 install -m 0755 ${WORKDIR}/bootchartd_stop.sh ${D}${sysconfdir}/init.d
130
131 echo 'EXIT_PROC="$EXIT_PROC matchbox-window-manager"' >> ${D}${sysconfdir}/bootchartd.conf
132}
133
134PACKAGES =+ "pybootchartgui"
135FILES_pybootchartgui += "${libdir}/python*/site-packages/pybootchartgui ${bindir}/pybootchartgui"
136RDEPENDS_pybootchartgui = "python-pycairo python-compression python-image python-textutils python-shell python-compression python-codecs"
137DEPENDS_append_class-native = " python-pycairo-native"
138
139PACKAGES =+ "bootchartd-stop-initscript"
140FILES_bootchartd-stop-initscript += "${sysconfdir}/init.d ${sysconfdir}/rc*.d"
141
142FILES_${PN} += "${base_libdir}/bootchart/bootchart-collector"
143FILES_${PN} += "${base_libdir}/bootchart/tmpfs"
144FILES_${PN} += "${libdir}"
145FILES_${PN}-dbg += "${base_libdir}/bootchart/.debug"
146FILES_${PN}-doc += "${datadir}/docs"
147
148RCONFLICTS_${PN} = "bootchart"