diff options
Diffstat (limited to 'envsetup.sh')
-rw-r--r-- | envsetup.sh | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/envsetup.sh b/envsetup.sh index bab2d25..26784ad 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -146,6 +146,10 @@ function setpaths() unset ANDROID_HOST_OUT export ANDROID_HOST_OUT=$(get_abs_build_var HOST_OUT) + # needed for processing samples collected by perf counters + unset OPROFILE_EVENTS_DIR + export OPROFILE_EVENTS_DIR=$T/external/oprofile/events + # needed for building linux on MacOS # TODO: fix the path #export HOST_EXTRACFLAGS="-I "$T/system/kernel_headers/host_include @@ -502,8 +506,8 @@ complete -F _lunch lunch # Run tapas with one ore more app names (from LOCAL_PACKAGE_NAME) function tapas() { - local variant=$(echo -n $(echo $* | xargs -n 1 echo | grep -E '^(user|userdebug|eng)$')) - local apps=$(echo -n $(echo $* | xargs -n 1 echo | grep -E -v '^(user|userdebug|eng)$')) + local variant=$(echo -n $(echo $* | xargs -n 1 echo | \grep -E '^(user|userdebug|eng)$')) + local apps=$(echo -n $(echo $* | xargs -n 1 echo | \grep -E -v '^(user|userdebug|eng)$')) if [ $(echo $variant | wc -w) -gt 1 ]; then echo "tapas: Error: Multiple build variants supplied: $variant" @@ -611,12 +615,17 @@ function mmm() T=$(gettop) if [ "$T" ]; then local MAKEFILE= + local MODULES= local ARGS= local DIR TO_CHOP local DASH_ARGS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/') local DIRS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/') for DIR in $DIRS ; do - DIR=`echo $DIR | sed -e 's:/$::'` + MODULES=`echo $DIR | sed -n -e 's/.*:\(.*$\)/\1/p' | sed 's/,/ /'` + if [ "$MODULES" = "" ]; then + MODULES=all_modules + fi + DIR=`echo $DIR | sed -e 's/:.*//' -e 's:/$::'` if [ -f $DIR/Android.mk ]; then TO_CHOP=`(cd -P -- $T && pwd -P) | wc -c | tr -d ' '` TO_CHOP=`expr $TO_CHOP + 1` @@ -643,7 +652,7 @@ function mmm() fi fi done - ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS all_modules $ARGS + ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T $DASH_ARGS $MODULES $ARGS else echo "Couldn't locate the top of the tree. Try setting TOP." fi @@ -704,6 +713,14 @@ function gdbclient() local OUT_SO_SYMBOLS=$(get_abs_build_var TARGET_OUT_SHARED_LIBRARIES_UNSTRIPPED) local OUT_EXE_SYMBOLS=$(get_abs_build_var TARGET_OUT_EXECUTABLES_UNSTRIPPED) local PREBUILTS=$(get_abs_build_var ANDROID_PREBUILTS) + local ARCH=$(get_build_var TARGET_ARCH) + local GDB + case "$ARCH" in + x86) GDB=i686-android-linux-gdb;; + arm) GDB=arm-linux-androideabi-gdb;; + *) echo "Unknown arch $ARCH"; return 1;; + esac + if [ "$OUT_ROOT" -a "$PREBUILTS" ]; then local EXE="$1" if [ "$EXE" ] ; then @@ -744,7 +761,7 @@ function gdbclient() echo >>"$OUT_ROOT/gdbclient.cmds" "target remote $PORT" echo >>"$OUT_ROOT/gdbclient.cmds" "" - arm-linux-androideabi-gdb -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE" + $GDB -x "$OUT_ROOT/gdbclient.cmds" "$OUT_EXE_SYMBOLS/$EXE" else echo "Unable to determine build system output dir." fi @@ -908,7 +925,7 @@ function runhat() echo "Running hat on $localFile" echo "View the output by pointing your browser at http://localhost:7000/" echo "" - hat $localFile + hat -JXmx512m $localFile } function getbugreports() @@ -1007,7 +1024,7 @@ function godir () { echo "" fi local lines - lines=($(grep "$1" $T/filelist | sed -e 's/\/[^/]*$//' | sort | uniq)) + lines=($(\grep "$1" $T/filelist | sed -e 's/\/[^/]*$//' | sort | uniq)) if [[ ${#lines[@]} = 0 ]]; then echo "Not found" return |