Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: tools/android-ll-prof.sh

Issue 10908122: Add support for running low level profiler on Android. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/android-ll-prof.sh
diff --git a/tools/android-ll-prof.sh b/tools/android-ll-prof.sh
new file mode 100755
index 0000000000000000000000000000000000000000..1f0f02ddb7859da0dae74652cf95a3ea4d79d625
--- /dev/null
+++ b/tools/android-ll-prof.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+
Michael Starzinger 2012/09/06 14:23:16 Copyright header is missing.
ulan 2012/09/06 14:31:27 Done.
+# Runs d8 with the given arguments on the device under 'perf' and
+# processes the profiler trace and v8 logs using ll_prof.py.
+#
+# Usage:
+# > ./tools/android-ll-prof.sh (debug|release) "args to d8" "args to ll_prof.py"
+#
+# The script assumes that the current directory is the v8 root directory.
+# It creates deploy directory ./deploy/data/local/tmp/v8, copies there the d8
+# binary either from out/android_arm.release or out/android_arm.debug, and
+# then sync the deploy directory with /data/local/tmp/v8 on the device.
+# You can put JS files in the deploy directory before running the script.
+# Note: $ANDROID_NDK_ROOT must be set.
+
+MODE=$1
+RUN_ARGS=$2
+LL_PROF_ARGS=$3
+
+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.
+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.
+
+set +e
+mkdir -p "$DEPLOY/data/local/tmp/v8"
+
+cp "$BASE/out/android_arm.$MODE/d8" "$DEPLOY/data/local/tmp/v8/d8"
+
+adb -p "$DEPLOY" sync data
+
+adb shell "cd /data/local/tmp/v8;\
+ perf record -R -e cycles -c 10000 -f -i \
+ ./d8 --ll_prof --gc-fake-mmap=/data/local/tmp/__v8_gc__ $RUN_ARGS"
+
+adb pull /data/local/tmp/v8/v8.log .
+adb pull /data/local/tmp/v8/v8.log.ll .
+adb pull /data/perf.data .
+
+ARCH=arm-linux-androideabi-4.4.3
+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.
+
+$BASE/tools/ll_prof.py --host-root="$BASE/deploy" \
+ --gc-fake-mmap=/data/local/tmp/__v8_gc__ \
+ --objdump="$TOOLCHAIN/arm-linux-androideabi-objdump" \
+ $LL_PROF_ARGS
« src/platform-linux.cc ('K') | « src/platform-openbsd.cc ('k') | tools/ll_prof.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698