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