runClient.sh 795 Bytes
Newer Older
1 2
#!/bin/bash

3 4 5 6
# set default lib path
if [ -z "${DISL_LIB_P}" ]; then
	DISL_LIB_P=./build
fi
7

8
# test number of arguments
9
if [ $# -lt 2 ]; then
10
	echo "Usage: `basename $0` instr-lib java-params"
11
	exit 1
12
fi
13

14
# determine libs depending on the OS
15
OS=`uname`
16
if [ "${OS}" = "Darwin" ]; then
Lukáš Marek's avatar
Lukáš Marek committed
17
	C_AGENT="${DISL_LIB_P}/libdislagent.jnilib"
18
	RE_AGENT="${DISL_LIB_P}/libdislreagent.jnilib"
19
else
Lukáš Marek's avatar
Lukáš Marek committed
20
	C_AGENT="${DISL_LIB_P}/libdislagent.so"
21
	RE_AGENT="${DISL_LIB_P}/libdislreagent.so"
22 23
fi

24 25 26 27
# get instrumentation library and shift parameters
INSTR_LIB=$1
shift

28 29
# start the client
${JAVA_HOME:+$JAVA_HOME/jre/bin/}java \
Lukáš Marek's avatar
Lukáš Marek committed
30 31 32
	-agentpath:${C_AGENT} -agentpath:${RE_AGENT} \
	-javaagent:${DISL_LIB_P}/disl-agent.jar \
	-Xbootclasspath/a:${DISL_LIB_P}/disl-agent.jar:${INSTR_LIB}:${DISL_LIB_P}/dislre-dispatch.jar \
33
	"$@"