blob: 2c56698a15fadc2bdb1d9129631c2a432f25402c [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001#!/bin/sh
2#
Elliott Hughes7c0c15f2015-03-06 13:25:32 -08003# This script is used to retrieve a bootchart log generated by init.
Mark Salyzynd4e5c322015-02-24 08:28:07 -08004# All options are passed to adb, for better or for worse.
Elliott Hughes7c0c15f2015-03-06 13:25:32 -08005# See the readme in this directory for more on bootcharting.
6
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08007TMPDIR=/tmp/android-bootchart
8rm -rf $TMPDIR
9mkdir -p $TMPDIR
10
11LOGROOT=/data/bootchart
12TARBALL=bootchart.tgz
13
Elliott Hughesa3641af2016-11-10 17:43:47 -080014FILES="header proc_stat.log proc_ps.log proc_diskstats.log"
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080015
16for f in $FILES; do
Mark Salyzynd4e5c322015-02-24 08:28:07 -080017 adb "${@}" pull $LOGROOT/$f $TMPDIR/$f 2>&1 > /dev/null
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080018done
19(cd $TMPDIR && tar -czf $TARBALL $FILES)
Victor Chang6b15a6b2018-10-31 20:58:14 +000020pybootchartgui ${TMPDIR}/${TARBALL}
21xdg-open ${TARBALL%.tgz}.png
Elliott Hughes7c0c15f2015-03-06 13:25:32 -080022echo "Clean up ${TMPDIR}/ and ./${TARBALL%.tgz}.png when done"