Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/bash | |
| 2 | |
|
Michael Starzinger
2012/09/06 14:23:16
Copyright header is missing.
ulan
2012/09/06 14:31:27
Done.
| |
| 3 # Runs d8 with the given arguments on the device under 'perf' and | |
| 4 # processes the profiler trace and v8 logs using ll_prof.py. | |
| 5 # | |
| 6 # Usage: | |
| 7 # > ./tools/android-ll-prof.sh (debug|release) "args to d8" "args to ll_prof.py" | |
| 8 # | |
| 9 # The script assumes that the current directory is the v8 root directory. | |
| 10 # It creates deploy directory ./deploy/data/local/tmp/v8, copies there the d8 | |
| 11 # binary either from out/android_arm.release or out/android_arm.debug, and | |
| 12 # then sync the deploy directory with /data/local/tmp/v8 on the device. | |
| 13 # You can put JS files in the deploy directory before running the script. | |
| 14 # Note: $ANDROID_NDK_ROOT must be set. | |
| 15 | |
| 16 MODE=$1 | |
| 17 RUN_ARGS=$2 | |
| 18 LL_PROF_ARGS=$3 | |
| 19 | |
| 20 BASE=`pwd` | |
|
Michael Starzinger
2012/09/06 14:23:16
You could use the following to compute the base pa
ulan
2012/09/06 14:31:27
Done.
| |
| 21 DEPLOY=$BASE/deploy | |
|
Michael Starzinger
2012/09/06 14:23:16
Put quotes around the value of DEPLOY.
ulan
2012/09/06 14:31:27
Done.
| |
| 22 | |
| 23 set +e | |
| 24 mkdir -p "$DEPLOY/data/local/tmp/v8" | |
| 25 | |
| 26 cp "$BASE/out/android_arm.$MODE/d8" "$DEPLOY/data/local/tmp/v8/d8" | |
| 27 | |
| 28 adb -p "$DEPLOY" sync data | |
| 29 | |
| 30 adb shell "cd /data/local/tmp/v8;\ | |
| 31 perf record -R -e cycles -c 10000 -f -i \ | |
| 32 ./d8 --ll_prof --gc-fake-mmap=/data/local/tmp/__v8_gc__ $RUN_ARGS" | |
| 33 | |
| 34 adb pull /data/local/tmp/v8/v8.log . | |
| 35 adb pull /data/local/tmp/v8/v8.log.ll . | |
| 36 adb pull /data/perf.data . | |
| 37 | |
| 38 ARCH=arm-linux-androideabi-4.4.3 | |
| 39 TOOLCHAIN=${ANDROID_NDK_ROOT}/toolchains/$ARCH/prebuilt/linux-x86/bin | |
|
Michael Starzinger
2012/09/06 14:23:16
Put quotes around the value of TOOLCHAIN.
ulan
2012/09/06 14:31:27
Done.
| |
| 40 | |
| 41 $BASE/tools/ll_prof.py --host-root="$BASE/deploy" \ | |
| 42 --gc-fake-mmap=/data/local/tmp/__v8_gc__ \ | |
| 43 --objdump="$TOOLCHAIN/arm-linux-androideabi-objdump" \ | |
| 44 $LL_PROF_ARGS | |
| OLD | NEW |