Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 261648 Details for
Bug 345695
app-benchmarks/bootchart2-0.12.4.ebuild (New Package)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
second patch, making LIBDIR changeable
0002-Make-LIBDIR-changeable.patch (text/plain), 13.27 KB, created by
Xake
on 2011-02-06 15:19:20 UTC
(
hide
)
Description:
second patch, making LIBDIR changeable
Filename:
MIME Type:
Creator:
Xake
Created:
2011-02-06 15:19:20 UTC
Size:
13.27 KB
patch
obsolete
>From 92bfe47ed6f181db77449b35d12090ca1f59ca44 Mon Sep 17 00:00:00 2001 >From: Peter Hjalmarsson <xake@rymdraket.net> >Date: Sun, 6 Feb 2011 16:12:59 +0100 >Subject: [PATCH 2/2] Make LIBDIR changeable > >This is more or less so distributions can choose between /lib{,64} >as anything else breaks with hardcoded paths in other places. > >This unbreaks some 64-bit setups with regards to debugging and debuginfo >being split out. > >Thanks Lucian Muresan <lmuresan70@googlemail.com> for initial patch >--- > Makefile | 18 +++-- > bootchartd | 200 -------------------------------------------------------- > bootchartd.in | 201 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 212 insertions(+), 207 deletions(-) > delete mode 100755 bootchartd > create mode 100755 bootchartd.in > >diff --git a/Makefile b/Makefile >index 1d9154a..57f5a46 100644 >--- a/Makefile >+++ b/Makefile >@@ -8,16 +8,17 @@ CFLAGS ?= -g -Wall -O0 > BINDIR ?= /usr/bin > PYTHON ?= python > DOCDIR ?= /usr/share/docs/bootchart >+LIBDIR ?= /lib > ifndef PY_LIBDIR > ifndef NO_PYTHON_COMPILE > PY_LIBDIR := $(shell $(PYTHON) -c "from distutils import sysconfig; print(sysconfig.get_config_var('DESTLIB'))") > else >-PY_LIBDIR = /usr/lib/python2.6 >+PY_LIBDIR = /usr${LIBDIR}/python2.6 > endif > endif > PY_SITEDIR ?= $(PY_LIBDIR)/site-packages >-LIBC_A_PATH = /usr/lib >-SYSTEMD_UNIT_DIR = /lib/systemd/system >+LIBC_A_PATH = /usr${LIBDIR} >+SYSTEMD_UNIT_DIR = ${LIBDIR}/systemd/system > COLLECTOR = \ > collector/collector.o \ > collector/output.o \ >@@ -25,11 +26,14 @@ COLLECTOR = \ > collector/tasks-netlink.o \ > collector/dump.o > >-all: bootchart-collector pybootchartgui/main.py >+all: bootchart-collector bootchartd pybootchartgui/main.py > > %.o:%.c > $(CC) $(CFLAGS) $(LDFLAGS) -pthread -DVERSION=\"$(VER)\" -c $^ -o $@ > >+bootchartd: bootchartd.in >+ sed -s "s:@LIBDIR@:${LIBDIR}:g" $^ > $@ >+ > bootchart-collector: $(COLLECTOR) > $(CC) $(CFLAGS) $(LDFLAGS) -pthread -Icollector -o $@ $^ > >@@ -45,12 +49,12 @@ py-install-compile: pybootchartgui/main.py > PYTHONOPTIMIZE=1 $(PYTHON) $(PY_LIBDIR)/py_compile.py *.py ); : > > install-chroot: >- install -d $(DESTDIR)/lib/bootchart/tmpfs >+ install -d $(DESTDIR)${LIBDIR}/bootchart/tmpfs > > install-collector: all install-chroot > install -m 755 -D bootchartd $(DESTDIR)/sbin/bootchartd > install -m 644 -D bootchartd.conf $(DESTDIR)/etc/bootchartd.conf >- install -m 755 -D bootchart-collector $(DESTDIR)/lib/bootchart/bootchart-collector >+ install -m 755 -D bootchart-collector $(DESTDIR)${LIBDIR}/bootchart/bootchart-collector > > install-docs: > install -m 644 -D README $(DESTDIR)$(DOCDIR)/README >@@ -67,7 +71,7 @@ install: all py-install-compile install-collector install-service install-docs > > clean: > -rm -f bootchart-collector bootchart-collector-dynamic \ >- collector/*.o pybootchartgui/main.py >+ collector/*.o pybootchartgui/main.py bootchartd > > dist: > COMMIT_HASH=`git show-ref -s -h | head -n 1` ; \ >diff --git a/bootchartd b/bootchartd >deleted file mode 100755 >index c6f4bff..0000000 >--- a/bootchartd >+++ /dev/null >@@ -1,200 +0,0 @@ >-#!/bin/bash >-# >-# Bootchart logger script >-# Ziga Mahkovec <ziga.mahkovec@klika.si> >-# Michael Meeks <michael.meeks@novell.com> >-# >-# This script is used for data collection for the bootchart2 >-# boot performance visualization tool. >-# >-# To profile the boot process, bootchartd should be called instead of >-# /sbin/init. Modify the kernel command line to include: >-# >-# init=/sbin/bootchartd initcall_debug printk.time=y quiet >-# >-# bootchartd will then start itself in background and exec /sbin/init >-# (or an alternative init process if specified using bootchart_init=) >-# >-# To profile a running system, run: >-# $ /sbin/bootchartd start; sleep 30; /sbin/bootchartd stop >-# >- >-# Use a directory we know will be there, such that we can mount >-# our 'proc' without having to touch a (potentially) read-only >-# file-system. >-TMPFS="/lib/bootchart/tmpfs" >-COLLECTOR_BIN="/lib/bootchart/bootchart-collector" >- >-# some initrds don't have usleep etc. >-USLEEP="$COLLECTOR_BIN --usleep" >- >-# we need to find our tools >-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 >-AUTO_RENDER="no" >-AUTO_RENDER_DIR="/var/log" >-AUTO_RENDER_FORMAT="png" >- >-# The processes we have to wait for >-EXIT_PROC="kdm_greet xterm konsole gnome-terminal metacity mutter compiz ldm icewm-session enlightenment" >- >-# Read configuration. >-CONF="/etc/bootchartd.conf" >-if [ -f $PWD/bootchartd.conf ]; then >- . $PWD/bootchartd.conf >-elif [ -f $CONF ]; then >- . $CONF >-else >- echo "$CONF missing" >-fi >- >-# Start the boot logger. >-start() >-{ >- # If in init start ourselves in our familiar system >- if [ -n "$INIT_PROCESS" ]; then >-# echo "bootchartd started in init" >> kmsg >- $COLLECTOR_BIN $SAMPLE_HZ >- >- # Otherwise, manually launched to profile something >- else >- # bail out, if already running >- pidof bootchart-collector && exit 0 >-# echo "bootchartd started manually" >> kmsg >- $COLLECTOR_BIN -r $SAMPLE_HZ & >- >- if [ "$#" -gt 0 ]; then >- # If a command was passed, run it >- # (used for profiling specific applications) >- echo "profile.process = $( basename $1 )" >> header >- $@ >- stop >- else >- echo "no command passed, you need to manually stop the service sometime" >- fi >- fi >-} >- >-# Wait for the boot process to end. >-wait_boot() >-{ >- # Wait for /proc first - without it we have issues >- while [ ! -e /proc/cmdline ]; do >- $USLEEP 5000 >- done >- >- while true; do >- if [ -n "$EXIT_PROC" -a -n "$( pidof $EXIT_PROC )" ]; then >- # give an unambiguous settle afterwards - so we get >- # more post-login data for slow systems >- $USLEEP 20000000 >- >- # Write / flush the log files >- stop >- return >- fi >- $USLEEP 1000000 >- done; >-} >- >-# Extract the log data from the running bootchart collector >-# process (via ptrace) - fun. Store logs into $BOOTLOG_DEST. >-stop() >-{ >- tmpdir=`mktemp -d /tmp/bootchart.XXXXXXXXXX` >- if [ "z$tmpdir" = "z" ]; then >- echo "Failed to generate directory for logging" >- exit 1 >- fi >- >- if ! $COLLECTOR_BIN --dump $tmpdir; then >- echo "Can't extract boot chart from collector" >- exit 1 >- fi >- >- cd $tmpdir >- if [ ! -e proc_stat.log ]; then >- echo "Can't find bootchart output in $tmpdir - aborting" >- exit 1 >- fi >- >- # Archive it all up into the bootchart output >- tar -zcf "$BOOTLOG_DEST" header dmesg *.log >- >- rm -Rf $tmpdir >- >- # Render the chart if configured (and the renderer is installed) >- if [ "$AUTO_RENDER" = "yes" -a -x /usr/bin/pybootchartgui ]; then >- cd $AUTO_RENDER_DIR >- /usr/bin/pybootchartgui -o "$AUTO_RENDER_DIR"/bootchart.$AUTO_RENDER_FORMAT -f $AUTO_RENDER_FORMAT "$BOOTLOG_DEST" >- fi >-} >- >-if [ $$ -eq 1 ]; then >- # Either started by the kernel - in which case, we start the >- # logger in background and exec init [ re-using this pid (1) ] >- # Or - started after the initrd has completed, in which case >- # we try to do nothing much. >- INIT_PROCESS="yes" >- echo "Starting bootchart logging" >- >- init="/sbin/init" >- >- # Are we running in the initrd ? >- if [ -x /init -o -x /linuxrc ]; then >- IN_INITRD="yes" >- [ -x /linuxrc ] && init="/linuxrc" >- [ -x /init ] && init="/init" >- start & >- else # running inside the main system >- echo "bootchart: no initrd used; starting" >- start & >- wait_boot & >- # wait a little, until the collector is going, before allowing >- # the rest of the system to charge ahead, so we catch it >- $USLEEP 250000 >- echo "bootchart continuing boot" >> $TMPFS/kmsg >- fi >- >- # Optionally, an alternative init(1) process may be specified using >- # the kernel command line (e.g. "bootchart_init=/sbin/initng") >- for i in $@; do >- if [ "${i%%=*}" = "bootchart_init" ]; then >- init="${i#*=}" >- break >- fi >- if [ "${i%%=*}" = "init" ]; then >- _init=${i#*=} >- if test "$_init" != "/sbin/bootchartd"; then >- init="$_init" >- break >- fi >- fi >- done >- export PATH=$OLDPATH >- >- # switch to - either the initrd's init, or the main system's >- exec $init $* >-fi >- >-case "$1" in >- "start") >- # Started by the user >- shift >- start $@ >- ;; >- "wait") >- # Wait for boot >- wait_boot >- ;; >- "stop") >- stop >- ;; >- *) >- echo "Usage: $0 {init|start|stop}" >- ;; >-esac >- >diff --git a/bootchartd.in b/bootchartd.in >new file mode 100755 >index 0000000..3c13c10 >--- /dev/null >+++ b/bootchartd.in >@@ -0,0 +1,201 @@ >+#!/bin/bash >+# >+# Bootchart logger script >+# Ziga Mahkovec <ziga.mahkovec@klika.si> >+# Michael Meeks <michael.meeks@novell.com> >+# >+# This script is used for data collection for the bootchart2 >+# boot performance visualization tool. >+# >+# To profile the boot process, bootchartd should be called instead of >+# /sbin/init. Modify the kernel command line to include: >+# >+# init=/sbin/bootchartd initcall_debug printk.time=y quiet >+# >+# bootchartd will then start itself in background and exec /sbin/init >+# (or an alternative init process if specified using bootchart_init=) >+# >+# To profile a running system, run: >+# $ /sbin/bootchartd start; sleep 30; /sbin/bootchartd stop >+# >+ >+# Use a directory we know will be there, such that we can mount >+# our 'proc' without having to touch a (potentially) read-only >+# file-system. >+LIBDIR="@LIBDIR@" >+TMPFS="${LIBDIR}/bootchart/tmpfs" >+COLLECTOR_BIN="${LIBDIR}/bootchart/bootchart-collector" >+ >+# some initrds don't have usleep etc. >+USLEEP="$COLLECTOR_BIN --usleep" >+ >+# we need to find our tools >+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 >+AUTO_RENDER="no" >+AUTO_RENDER_DIR="/var/log" >+AUTO_RENDER_FORMAT="png" >+ >+# The processes we have to wait for >+EXIT_PROC="kdm_greet xterm konsole gnome-terminal metacity mutter compiz ldm icewm-session enlightenment" >+ >+# Read configuration. >+CONF="/etc/bootchartd.conf" >+if [ -f $PWD/bootchartd.conf ]; then >+ . $PWD/bootchartd.conf >+elif [ -f $CONF ]; then >+ . $CONF >+else >+ echo "$CONF missing" >+fi >+ >+# Start the boot logger. >+start() >+{ >+ # If in init start ourselves in our familiar system >+ if [ -n "$INIT_PROCESS" ]; then >+# echo "bootchartd started in init" >> kmsg >+ $COLLECTOR_BIN $SAMPLE_HZ >+ >+ # Otherwise, manually launched to profile something >+ else >+ # bail out, if already running >+ pidof bootchart-collector && exit 0 >+# echo "bootchartd started manually" >> kmsg >+ $COLLECTOR_BIN -r $SAMPLE_HZ & >+ >+ if [ "$#" -gt 0 ]; then >+ # If a command was passed, run it >+ # (used for profiling specific applications) >+ echo "profile.process = $( basename $1 )" >> header >+ $@ >+ stop >+ else >+ echo "no command passed, you need to manually stop the service sometime" >+ fi >+ fi >+} >+ >+# Wait for the boot process to end. >+wait_boot() >+{ >+ # Wait for /proc first - without it we have issues >+ while [ ! -e /proc/cmdline ]; do >+ $USLEEP 5000 >+ done >+ >+ while true; do >+ if [ -n "$EXIT_PROC" -a -n "$( pidof $EXIT_PROC )" ]; then >+ # give an unambiguous settle afterwards - so we get >+ # more post-login data for slow systems >+ $USLEEP 20000000 >+ >+ # Write / flush the log files >+ stop >+ return >+ fi >+ $USLEEP 1000000 >+ done; >+} >+ >+# Extract the log data from the running bootchart collector >+# process (via ptrace) - fun. Store logs into $BOOTLOG_DEST. >+stop() >+{ >+ tmpdir=`mktemp -d /tmp/bootchart.XXXXXXXXXX` >+ if [ "z$tmpdir" = "z" ]; then >+ echo "Failed to generate directory for logging" >+ exit 1 >+ fi >+ >+ if ! $COLLECTOR_BIN --dump $tmpdir; then >+ echo "Can't extract boot chart from collector" >+ exit 1 >+ fi >+ >+ cd $tmpdir >+ if [ ! -e proc_stat.log ]; then >+ echo "Can't find bootchart output in $tmpdir - aborting" >+ exit 1 >+ fi >+ >+ # Archive it all up into the bootchart output >+ tar -zcf "$BOOTLOG_DEST" header dmesg *.log >+ >+ rm -Rf $tmpdir >+ >+ # Render the chart if configured (and the renderer is installed) >+ if [ "$AUTO_RENDER" = "yes" -a -x /usr/bin/pybootchartgui ]; then >+ cd $AUTO_RENDER_DIR >+ /usr/bin/pybootchartgui -o "$AUTO_RENDER_DIR"/bootchart.$AUTO_RENDER_FORMAT -f $AUTO_RENDER_FORMAT "$BOOTLOG_DEST" >+ fi >+} >+ >+if [ $$ -eq 1 ]; then >+ # Either started by the kernel - in which case, we start the >+ # logger in background and exec init [ re-using this pid (1) ] >+ # Or - started after the initrd has completed, in which case >+ # we try to do nothing much. >+ INIT_PROCESS="yes" >+ echo "Starting bootchart logging" >+ >+ init="/sbin/init" >+ >+ # Are we running in the initrd ? >+ if [ -x /init -o -x /linuxrc ]; then >+ IN_INITRD="yes" >+ [ -x /linuxrc ] && init="/linuxrc" >+ [ -x /init ] && init="/init" >+ start & >+ else # running inside the main system >+ echo "bootchart: no initrd used; starting" >+ start & >+ wait_boot & >+ # wait a little, until the collector is going, before allowing >+ # the rest of the system to charge ahead, so we catch it >+ $USLEEP 250000 >+ echo "bootchart continuing boot" >> $TMPFS/kmsg >+ fi >+ >+ # Optionally, an alternative init(1) process may be specified using >+ # the kernel command line (e.g. "bootchart_init=/sbin/initng") >+ for i in $@; do >+ if [ "${i%%=*}" = "bootchart_init" ]; then >+ init="${i#*=}" >+ break >+ fi >+ if [ "${i%%=*}" = "init" ]; then >+ _init=${i#*=} >+ if test "$_init" != "/sbin/bootchartd"; then >+ init="$_init" >+ break >+ fi >+ fi >+ done >+ export PATH=$OLDPATH >+ >+ # switch to - either the initrd's init, or the main system's >+ exec $init $* >+fi >+ >+case "$1" in >+ "start") >+ # Started by the user >+ shift >+ start $@ >+ ;; >+ "wait") >+ # Wait for boot >+ wait_boot >+ ;; >+ "stop") >+ stop >+ ;; >+ *) >+ echo "Usage: $0 {init|start|stop}" >+ ;; >+esac >+ >-- >1.7.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 345695
:
254457
|
255851
|
261388
|
261647
|
261648
|
262087
|
262089
|
264331
|
264333
|
264335
|
264337
|
264341
|
264345
|
264347
|
275053
|
275055