#
# Copyright (c) 2013-2014 Qualcomm Technologies, Inc. All Rights Reserved.
# Qualcomm Technologies Proprietary and Confidential.
#
# From Android, run perf using the glibc binary and libraries supplied
# in the SPV chroot.
# Execute ld-linux.so to run perf, using the SPV glibc libraries.

SPV_ROOT="/data/data/com.qualcomm.spv"

# Turn off Android's preload - we do not want to use Android libraries
unset LD_PRELOAD

# read install_location to see where SPV is installed
spv_location=`cat $SPV_ROOT/install_location`

# run perf using glibc libraries and the arguments passed to this script
$spv_location/chroot/lib/ld-linux.so.3 --library-path $spv_location/chroot/lib:$spv_location/chroot/usr/lib $spv_location/chroot/usr/local/bin/perfdir/perf $@
