diff options
Diffstat (limited to 'poky/meta/recipes-devtools/bootchart2')
4 files changed, 249 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch b/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch new file mode 100644 index 000000000..118814a80 --- /dev/null +++ b/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch @@ -0,0 +1,30 @@ +From 2225ab2038bfe50f16f972e39d89bcd0bd7767f5 Mon Sep 17 00:00:00 2001 +From: Steffen Pankratz <kratz00@gmx.de> +Date: Tue, 9 Feb 2016 13:49:42 +0100 +Subject: [PATCH] Fixed: Missing default value for BOOTLOG_DEST + +Upstream-Status: Backport + +BUILDLOG_DEST seems to be a typo or mix-up which was introduced with 281d1df80884bf2969c509ec60ee8a6593524fe8 + +Signed-off-by: Peter Liu <peter.x.liu@external.atlascopco.com> +--- + bootchartd.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/bootchartd.in b/bootchartd.in +index f58ab9e..30af677 100755 +--- a/bootchartd.in ++++ b/bootchartd.in +@@ -37,7 +37,7 @@ PATH="/sbin:/bin:/usr/sbin:/usr/bin:$PATH" + + # Defaults, in case we can't find our configuration + SAMPLE_HZ=50 +-BUILDLOG_DEST=/var/log/bootchart.tgz ++BOOTLOG_DEST=/var/log/bootchart.tgz + AUTO_RENDER="no" + AUTO_RENDER_DIR="/var/log" + AUTO_RENDER_FORMAT="png" +-- +1.9.1 + diff --git a/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch b/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch new file mode 100644 index 000000000..7a8813e96 --- /dev/null +++ b/poky/meta/recipes-devtools/bootchart2/bootchart2/0001-collector-Allocate-space-on-heap-for-chunks.patch @@ -0,0 +1,45 @@ +From 09505532b49573663fb4ff4dad424dc2ef4c1f84 Mon Sep 17 00:00:00 2001 +From: Kyle Russell <bkylerussell@gmail.com> +Date: Wed, 13 Jul 2016 17:30:00 -0400 +Subject: [PATCH] collector: Allocate space on heap for chunks + +Nicer for embedded devices which may have smaller stack limitations. + +Upstream-Status: Submitted [https://github.com/xrmx/bootchart/pull/74] + +Signed-off-by: Kyle Russell <bkylerussell@gmail.com> +--- + collector/dump.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/collector/dump.c b/collector/dump.c +index e673b5b..2f094b4 100644 +--- a/collector/dump.c ++++ b/collector/dump.c +@@ -184,12 +184,12 @@ static void dump_buffers (DumpState *s) + log ("reading %d chunks (of %d) ...\n", max_chunk, s->map.max_chunk); + for (i = 0; i < max_chunk; i++) { + FILE *output; +- char buffer[CHUNK_SIZE]; +- Chunk *c = (Chunk *)&buffer; ++ char *buffer = malloc(CHUNK_SIZE); ++ Chunk *c = (Chunk *)buffer; + size_t addr = (size_t) s->map.chunks[i]; + + lseek (s->mem, addr, SEEK_SET); +- read (s->mem, &buffer, CHUNK_SIZE); ++ read (s->mem, buffer, CHUNK_SIZE); + /* log ("type: '%s' len %d\n", + c->dest_stream, (int)c->length); */ + +@@ -197,6 +197,7 @@ static void dump_buffers (DumpState *s) + fwrite (c->data, 1, c->length, output); + bytes_dumped += c->length; + fclose (output); ++ free(buffer); + } + log ("wrote %ld kb\n", (long)(bytes_dumped+1023)/1024); + } +-- +2.7.4 + diff --git a/poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh b/poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh new file mode 100644 index 000000000..21a78877a --- /dev/null +++ b/poky/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh @@ -0,0 +1,18 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: bootchartd_stop +# Required-Start: $remote_fs $all +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: +# Short-Description: Stop bootchartd collection +# Description: This script accompanies bootchartd from bootchart2. +# bootchartd should stop detect the end of the boot process +# automatically if a window manager is launched, but for +# command-line only operating systems, this script should be +# used instead. +### END INIT INFO + +/sbin/bootchartd stop + +: exit 0 diff --git a/poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb b/poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb new file mode 100644 index 000000000..b3c889b0a --- /dev/null +++ b/poky/meta/recipes-devtools/bootchart2/bootchart2_0.14.8.bb @@ -0,0 +1,156 @@ +# Copyright (c) 2013 LG Electronics, Inc. +# Copyright (C) 2014 Intel Corp. + +# This recipe creates packages for the bootchart2 system-wide profiler daemon +# and related utilities. Depending on the images you're building, additional +# configuration may be needed in order to use it. +# +# Packages: +# * bootchart2 - The daemon itself. +# * pybootchartgui - Python program to visualize and display the data +# collected by bootchart2 or compatible daemons such as the original +# bootchart. +# * bootchartd-stop-initscript - A SysV init script to stop data collection +# when booting completes (see below for details.) +# +# While bootchart2 is designed to stop collecting data roughly when the boot +# process completes, it is not exactly a stopwatch. It has a list of programs +# which are supposed signify that the boot process has completed (for example, +# openbox or gnome-shell,) but it waits a full 20 seconds after such a program +# is launched before stopping itself, to collect additional data. +# +# If you are using a window manager or GUI which isn't included in bootchart2's +# default configuration file, you should write bbappend file to amend +# bootchartd.conf and add it to EXIT_PROC. An example of this is shown in this +# recipe, where the Matchbox window manager (used by Sato) is added. +# +# If you want data collection to end at a certain point exactly, you should +# arrange for the following command to be run: +# bootchartd stop +# You might set this command to be launched by the desktop environment shipped +# on the image you're building after the other startup programs are complete. +# This will not incur the 20 second wait period and will cause bootchart2 to +# behave a bit more like a stopwatch. An example of this is shown in this +# recipe, specifically the bootchartd-stop-initscript package, which stops data +# collection as the last action when switching to runlevels 2 through 5. You can +# add bootchartd-stop-initscript to IMAGE_INSTALL if you need to use it. +# +# Unless you're doing something special, if your image does not launch an X +# window manager, you will need to add bootchartd-stop-initscript to your image. +# +# Bootchart2 can be started in two ways. Data collection can be initiated by +# running the following command: +# bootchartd start +# However, for the most complete data, the bootchart2 developers recommend +# running it as PID 1. This can be done by adding the following to the kernel +# command line parameters in the bootloader setup: +# init=/sbin/bootchartd +# When invoked this way, bootchart2 will set itself up and then automatically +# run /sbin/init. For example, when booting the default qemux86 image, one might +# use a command like this: +# runqemu qemux86 bootparams="initcall_debug printk.time=y quiet \ +# init=/sbin/bootchartd" +# +# Neither method is actually implemented here, choose what works for you. +# +# If you are building your image with systemd instead of SysV init, bootchart2 +# includes systemd service files to begin collection automatically at boot and +# end collection automatically 20 seconds after the boot process has completed. +# However, be aware that systemd tends to start bootchart2 relatively late into +# the boot process, so it's highly recommended to use bootchart2 as PID 1. If +# you're using systemd and you wish to use another method to stop data +# collection at a time of your choosing, you may do so as long as you get to it +# before the 20 second timeout of the systemd service files. Also, you may write +# a bbappend to patch bootchart2-done.timer.in to increase or decrease the +# timeout. Decreasing it to 0 will make it behave like +# bootchartd-stop-initscript. +# +# By default, when data collection is stopped, a file named bootchart.tgz will +# be created in /var/log. If pybootchartgui is included in your image, +# bootchart.png will also be created at the same time. However, this results in +# a noticeable hitch or pause at boot time, which may not be what you want on an +# embedded device. So you may prefer to omit pybootchartgui from your image. In +# that case, copy bootchart.tgz over to your development system and generate +# bootchart.png there. To get pybootchartgui on your development system, you can +# either install it directly from some other source, or build bootchart2-native +# and find pybootchartgui in the native sysroot: +# bitbake bootchart2-native +# ./tmp/sysroots/x86_64-linux/usr/bin/pybootchartgui /path/to/bootchart.tgz +# Note that, whether installed on your build system or on your image, the +# pybootchartgui provided by this recipe does not support the -i option. You +# will need to install pybootchartgui by other means in order to run it in +# interactive mode. + +SUMMARY = "Booting sequence and CPU,I/O usage monitor" +DESCRIPTION = "Monitors where the system spends its time at start, creating a graph of all processes, disk utilization, and wait time." +AUTHOR = "Wonhong Kwon <wonhong.kwon@lge.com>" +HOMEPAGE = "https://github.com/mmeeks/bootchart" +LICENSE = "GPL-3.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=44ac4678311254db62edf8fd39cb8124" + +UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+\.\d+(\.\d+)*)" + +SRC_URI = "git://github.com/xrmx/bootchart.git \ + file://bootchartd_stop.sh \ + file://0001-Fixed-Missing-default-value-for-BOOTLOG_DEST.patch \ + file://0001-collector-Allocate-space-on-heap-for-chunks.patch \ + " + +S = "${WORKDIR}/git" +SRCREV = "48e0071048564c6af75ab969e842d6dec808da09" + +inherit systemd update-rc.d python3native update-alternatives + +ALTERNATIVE_${PN} = "bootchartd" +ALTERNATIVE_LINK_NAME[bootchartd] = "${base_sbindir}/bootchartd" +ALTERNATIVE_PRIORITY = "100" + +# The only reason to build bootchart2-native is for a native pybootchartgui. +BBCLASSEXTEND = "native" + +SYSTEMD_SERVICE_${PN} = "bootchart2.service bootchart2-done.service bootchart2-done.timer" + +UPDATERCPN = "bootchartd-stop-initscript" +INITSCRIPT_NAME = "bootchartd_stop.sh" +INITSCRIPT_PARAMS = "start 99 2 3 4 5 ." + +do_compile_prepend () { + export PY_LIBDIR="${libdir}/${PYTHON_DIR}" + export BINDIR="${bindir}" + export LIBDIR="${base_libdir}" +} + +do_install () { + install -d ${D}${sysconfdir} # needed for -native + export PY_LIBDIR="${libdir}/${PYTHON_DIR}" + export BINDIR="${bindir}" + export DESTDIR="${D}" + export LIBDIR="${base_libdir}" + + oe_runmake install + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/bootchartd_stop.sh ${D}${sysconfdir}/init.d + + echo 'EXIT_PROC="$EXIT_PROC matchbox-window-manager"' >> ${D}${sysconfdir}/bootchartd.conf + + # Use python 3 instead of python 2 + sed -i -e '1s,#!.*python.*,#!${USRBINPATH}/env python3,' ${D}${bindir}/pybootchartgui +} + +PACKAGES =+ "pybootchartgui" +FILES_pybootchartgui += "${PYTHON_SITEPACKAGES_DIR}/pybootchartgui ${bindir}/pybootchartgui" +RDEPENDS_pybootchartgui = "python3-pycairo python3-compression python3-image python3-shell python3-compression python3-codecs" +RDEPENDS_${PN}_class-target += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}" +RDEPENDS_${PN}_class-target += "lsb" +DEPENDS_append_class-native = " python3-pycairo-native" + +PACKAGES =+ "bootchartd-stop-initscript" +FILES_bootchartd-stop-initscript += "${sysconfdir}/init.d ${sysconfdir}/rc*.d" +RDEPENDS_bootchartd-stop-initscript = "${PN}" + +FILES_${PN} += "${base_libdir}/bootchart/bootchart-collector" +FILES_${PN} += "${base_libdir}/bootchart/tmpfs" +FILES_${PN} += "${libdir}" +FILES_${PN}-doc += "${datadir}/docs" + +RCONFLICTS_${PN} = "bootchart" |