2009-03-04 11:32:55 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# this script is used to retrieve the bootchart log generated
|
|
|
|
# by init when compiled with INIT_BOOTCHART=true.
|
|
|
|
#
|
2015-02-25 00:28:07 +08:00
|
|
|
# All options are passed to adb, for better or for worse.
|
|
|
|
#
|
2009-03-04 11:32:55 +08:00
|
|
|
# for all details, see //device/system/init/README.BOOTCHART
|
|
|
|
#
|
|
|
|
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
|
2015-02-25 00:28:07 +08:00
|
|
|
adb "${@}" pull $LOGROOT/$f $TMPDIR/$f 2>&1 > /dev/null
|
2009-03-04 11:32:55 +08:00
|
|
|
done
|
|
|
|
(cd $TMPDIR && tar -czf $TARBALL $FILES)
|
2015-02-25 00:28:07 +08:00
|
|
|
bootchart ${TMPDIR}/${TARBALL}
|
|
|
|
gnome-open ${TARBALL%.tgz}.png
|
|
|
|
echo "Clean up ${TMPDIR}/ & ./${TARBALL%.tgz}.png when done"
|