1*02ca8ccaSAndroid Build Coastguard Worker#!/bin/bash 2*02ca8ccaSAndroid Build Coastguard Worker# Script to set up the environment for testing perf with OpenCSD 3*02ca8ccaSAndroid Build Coastguard Worker# 4*02ca8ccaSAndroid Build Coastguard Worker# See HOWTO.md for details on how these environment variables should be set and used. 5*02ca8ccaSAndroid Build Coastguard Worker# 6*02ca8ccaSAndroid Build Coastguard Worker# to use this script:- 7*02ca8ccaSAndroid Build Coastguard Worker# 8*02ca8ccaSAndroid Build Coastguard Worker# 1) for perf exec env only 9*02ca8ccaSAndroid Build Coastguard Worker# source perf-setup-env.bash 10*02ca8ccaSAndroid Build Coastguard Worker# 11*02ca8ccaSAndroid Build Coastguard Worker# 2) for perf build and exec env 12*02ca8ccaSAndroid Build Coastguard Worker# source perf-setup-env.bash buildenv 13*02ca8ccaSAndroid Build Coastguard Worker# 14*02ca8ccaSAndroid Build Coastguard Worker 15*02ca8ccaSAndroid Build Coastguard Worker#------ User Edits Start ------- 16*02ca8ccaSAndroid Build Coastguard Worker# Edit as required for user system. 17*02ca8ccaSAndroid Build Coastguard Worker 18*02ca8ccaSAndroid Build Coastguard Worker# Root of the opencsd library project as cloned from github 19*02ca8ccaSAndroid Build Coastguard Workerexport OPENCSD_ROOT=~/work/opencsd-master 20*02ca8ccaSAndroid Build Coastguard Worker 21*02ca8ccaSAndroid Build Coastguard Worker# the opencsd build library directory to use. 22*02ca8ccaSAndroid Build Coastguard Workerexport OCSD_LIB_DIR=lib/builddir 23*02ca8ccaSAndroid Build Coastguard Worker 24*02ca8ccaSAndroid Build Coastguard Worker# the root of the perf branch / perf dev-tree as checked out 25*02ca8ccaSAndroid Build Coastguard Workerexport PERF_ROOT=~/work/kernel-dev 26*02ca8ccaSAndroid Build Coastguard Worker 27*02ca8ccaSAndroid Build Coastguard Worker# the arm x-compiler toolchain path 28*02ca8ccaSAndroid Build Coastguard Workerexport XTOOLS_PATH=~/work/gcc-x-aarch64-6.2/bin 29*02ca8ccaSAndroid Build Coastguard Worker 30*02ca8ccaSAndroid Build Coastguard Worker#------ User Edits End ------- 31*02ca8ccaSAndroid Build Coastguard Worker 32*02ca8ccaSAndroid Build Coastguard Worker# path to source/include root dir - used by perf build to 33*02ca8ccaSAndroid Build Coastguard Worker# include Opencsd decoder. 34*02ca8ccaSAndroid Build Coastguard Worker 35*02ca8ccaSAndroid Build Coastguard Workerif [ "$1" == "buildenv" ]; then 36*02ca8ccaSAndroid Build Coastguard Worker export CSTRACE_PATH=${OPENCSD_ROOT}/decoder 37*02ca8ccaSAndroid Build Coastguard Worker export CSLIBS=${CSTRACE_PATH}/${OCSD_LIB_DIR} 38*02ca8ccaSAndroid Build Coastguard Worker export CSINCLUDES=${CSTRACE_PATH}/include 39*02ca8ccaSAndroid Build Coastguard Worker 40*02ca8ccaSAndroid Build Coastguard Worker # add library to lib path 41*02ca8ccaSAndroid Build Coastguard Worker if [ "${LD_LIBRARY_PATH}" == "" ]; then 42*02ca8ccaSAndroid Build Coastguard Worker export LD_LIBRARY_PATH=${CSLIBS} 43*02ca8ccaSAndroid Build Coastguard Worker else 44*02ca8ccaSAndroid Build Coastguard Worker export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${CSLIBS} 45*02ca8ccaSAndroid Build Coastguard Worker fi 46*02ca8ccaSAndroid Build Coastguard Workerfi 47*02ca8ccaSAndroid Build Coastguard Worker 48*02ca8ccaSAndroid Build Coastguard Worker# perf script defines 49*02ca8ccaSAndroid Build Coastguard Workerexport PERF_EXEC_PATH=${PERF_ROOT}/tools/perf 50*02ca8ccaSAndroid Build Coastguard Workerexport PERF_SCRIPT_PATH=${PERF_EXEC_PATH}/scripts/python 51*02ca8ccaSAndroid Build Coastguard Worker 52