Home | History | Annotate | Download | only in init
      1 #!/bin/sh
      2 #
      3 # This script is used to retrieve a bootchart log generated by init.
      4 # All options are passed to adb, for better or for worse.
      5 # See the readme in this directory for more on bootcharting.
      6 
      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"
     15 
     16 for f in $FILES; do
     17     adb "${@}" pull $LOGROOT/$f $TMPDIR/$f 2>&1 > /dev/null
     18 done
     19 (cd $TMPDIR && tar -czf $TARBALL $FILES)
     20 bootchart ${TMPDIR}/${TARBALL}
     21 gnome-open ${TARBALL%.tgz}.png
     22 echo "Clean up ${TMPDIR}/ and ./${TARBALL%.tgz}.png when done"
     23