platform_system_core/init/grab-bootchart.sh
Elliott Hughes 7c0c15f0ed Fix outdated comments in grab-bootchart.sh.
I've been deliberately vague about the name of the readme because I want to
come back and switch to markdown, but that probably won't happen today.

Change-Id: I60651703709bbfd499227f882eb949396e8f4f6c
2015-03-06 13:25:32 -08:00

22 lines
636 B
Bash
Executable file

#!/bin/sh
#
# This script is used to retrieve a bootchart log generated by init.
# All options are passed to adb, for better or for worse.
# See the readme in this directory for more on bootcharting.
TMPDIR=/tmp/android-bootchart
rm -rf $TMPDIR
mkdir -p $TMPDIR
LOGROOT=/data/bootchart
TARBALL=bootchart.tgz
FILES="header proc_stat.log proc_ps.log proc_diskstats.log kernel_pacct"
for f in $FILES; do
adb "${@}" pull $LOGROOT/$f $TMPDIR/$f 2>&1 > /dev/null
done
(cd $TMPDIR && tar -czf $TARBALL $FILES)
bootchart ${TMPDIR}/${TARBALL}
gnome-open ${TARBALL%.tgz}.png
echo "Clean up ${TMPDIR}/ and ./${TARBALL%.tgz}.png when done"