| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # android_perf: utility for running perf on an android device | 3 # android_perf: utility for running perf on an android device |
| 4 # | 4 # |
| 5 # The basic usage sequence is to run... | 5 # The basic usage sequence is to run... |
| 6 # 1) perf record [gm/tests/bench] # runs profiler on specified app | 6 # 1) perf record [gm/tests/bench] # runs profiler on specified app |
| 7 # 2) perf report # prints profiler results | 7 # 2) perf report # prints profiler results |
| 8 # 3) perf clean # cleans the temporary directory used to store results | 8 # 3) perf clean # cleans the temporary directory used to store results |
| 9 # | 9 # |
| 10 | 10 |
| 11 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | 11 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
| 12 source $SCRIPT_DIR/android_setup.sh | 12 source $SCRIPT_DIR/android_setup.sh |
| 13 source $SCRIPT_DIR/utils/setup_adb.sh | 13 source $SCRIPT_DIR/utils/setup_adb.sh |
| 14 | 14 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 perf_setup() { | 36 perf_setup() { |
| 37 | 37 |
| 38 mkdir -p $TMP_SYS_BIN | 38 mkdir -p $TMP_SYS_BIN |
| 39 mkdir -p $TMP_SYS_LIB | 39 mkdir -p $TMP_SYS_LIB |
| 40 mkdir -p $TMP_APP_LOC | 40 mkdir -p $TMP_APP_LOC |
| 41 | 41 |
| 42 echo "Copying symbol files" | 42 echo "Copying symbol files" |
| 43 adb_pull_if_needed /system/lib/libc.so $TMP_SYS_LIB | 43 adb_pull_if_needed /system/lib/libc.so $TMP_SYS_LIB |
| 44 adb_pull_if_needed /system/lib/libstlport.so $TMP_SYS_LIB | 44 adb_pull_if_needed /system/lib/libstlport.so $TMP_SYS_LIB |
| 45 adb_pull_if_needed /system/lib/libcutils.so $TMP_SYS_LIB | |
| 46 adb_pull_if_needed /system/lib/libGLESv2.so $TMP_SYS_LIB | 45 adb_pull_if_needed /system/lib/libGLESv2.so $TMP_SYS_LIB |
| 47 adb_pull_if_needed /system/lib/libandroid.so $TMP_SYS_LIB | 46 adb_pull_if_needed /system/lib/libandroid.so $TMP_SYS_LIB |
| 48 adb_pull_if_needed /system/lib/libm.so $TMP_SYS_LIB | 47 adb_pull_if_needed /system/lib/libm.so $TMP_SYS_LIB |
| 49 adb_pull_if_needed /system/lib/libz.so $TMP_SYS_LIB | 48 adb_pull_if_needed /system/lib/libz.so $TMP_SYS_LIB |
| 50 | 49 |
| 51 # BUILDTYPE variable is set by android_setup.sh | 50 # BUILDTYPE variable is set by android_setup.sh |
| 52 BUILDDIR="${SKIA_OUT}/${BUILDTYPE}" | 51 BUILDDIR="${SKIA_OUT}/${BUILDTYPE}" |
| 53 if [ ! -f "${BUILDDIR}/lib/lib${runVars[0]}.so" ]; | 52 if [ ! -f "${BUILDDIR}/lib/lib${runVars[0]}.so" ]; |
| 54 then | 53 then |
| 55 echo "Unable to find the ${runVars[0]} library in ${BUILDDIR}/lib." | 54 echo "Unable to find the ${runVars[0]} library in ${BUILDDIR}/lib." |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 perf_clean | 111 perf_clean |
| 113 ;; | 112 ;; |
| 114 *) | 113 *) |
| 115 echo -n "ERROR: unknown perf command ($PERF_CMD), valid values: " | 114 echo -n "ERROR: unknown perf command ($PERF_CMD), valid values: " |
| 116 echo "setup, record, report, clean" | 115 echo "setup, record, report, clean" |
| 117 exit 1; | 116 exit 1; |
| 118 ;; | 117 ;; |
| 119 esac | 118 esac |
| 120 | 119 |
| 121 exit 0; | 120 exit 0; |
| OLD | NEW |