The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
Elliott Hughes | 7c0c15f | 2015-03-06 13:25:32 -0800 | [diff] [blame] | 3 | # This script is used to retrieve a bootchart log generated by init. |
Mark Salyzyn | d4e5c32 | 2015-02-24 08:28:07 -0800 | [diff] [blame] | 4 | # All options are passed to adb, for better or for worse. |
Elliott Hughes | 7c0c15f | 2015-03-06 13:25:32 -0800 | [diff] [blame] | 5 | # See the readme in this directory for more on bootcharting. |
| 6 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 7 | TMPDIR=/tmp/android-bootchart |
| 8 | rm -rf $TMPDIR |
| 9 | mkdir -p $TMPDIR |
| 10 | |
| 11 | LOGROOT=/data/bootchart |
| 12 | TARBALL=bootchart.tgz |
| 13 | |
Elliott Hughes | a3641af | 2016-11-10 17:43:47 -0800 | [diff] [blame] | 14 | FILES="header proc_stat.log proc_ps.log proc_diskstats.log" |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 15 | |
| 16 | for f in $FILES; do |
Mark Salyzyn | d4e5c32 | 2015-02-24 08:28:07 -0800 | [diff] [blame] | 17 | adb "${@}" pull $LOGROOT/$f $TMPDIR/$f 2>&1 > /dev/null |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 18 | done |
| 19 | (cd $TMPDIR && tar -czf $TARBALL $FILES) |
Victor Chang | 6b15a6b | 2018-10-31 20:58:14 +0000 | [diff] [blame] | 20 | pybootchartgui ${TMPDIR}/${TARBALL} |
| 21 | xdg-open ${TARBALL%.tgz}.png |
Elliott Hughes | 7c0c15f | 2015-03-06 13:25:32 -0800 | [diff] [blame] | 22 | echo "Clean up ${TMPDIR}/ and ./${TARBALL%.tgz}.png when done" |