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 | |
| 14 | FILES="header proc_stat.log proc_ps.log proc_diskstats.log kernel_pacct" |
| 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) |
Mark Salyzyn | d4e5c32 | 2015-02-24 08:28:07 -0800 | [diff] [blame] | 20 | bootchart ${TMPDIR}/${TARBALL} |
| 21 | gnome-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" |