blob: c4ff6dfaf4b328db8aed3de67db3f40c6eef7aa0 [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)
Mark Salyzynd4e5c322015-02-24 08:28:07 -080020bootchart ${TMPDIR}/${TARBALL}
21gnome-open ${TARBALL%.tgz}.png
Elliott Hughes7c0c15f2015-03-06 13:25:32 -080022echo "Clean up ${TMPDIR}/ and ./${TARBALL%.tgz}.png when done"