Accept agentpath as a parameter to the run script 18/5418/1
authorMoiz Raja <moraja@cisco.com>
Wed, 19 Feb 2014 20:04:36 +0000 (12:04 -0800)
committerMoiz Raja <moraja@cisco.com>
Wed, 19 Feb 2014 20:04:36 +0000 (12:04 -0800)
This is to be used when you want to start open daylight with say the yourkit profiling agent

Usage would be something like this,

./run.sh -agentpath:"/Applications/Yourkit.app/bin/mac/agent.lib"

Change-Id: I0034adab46dc5185e54dfb22c85985324f82d0fb
Signed-off-by: Moiz Raja <moraja@cisco.com>
opendaylight/distribution/opendaylight/src/main/resources/run.sh

index 90e3b03ae4b7168fcc51a70a32499caca2086515..64f2c877f7ea60f2e87f13bb9d4b173a11d7a16d 100755 (executable)
@@ -59,7 +59,7 @@ else
 fi
 
 function usage {
-    echo "Usage: $0 [-jmx] [-jmxport <num>] [-debug] [-debugsuspend] [-debugport <num>] [-start [<console port>]] [-stop] [-status] [-console] [-help] [<other args will automatically be used for the JVM>]"
+    echo "Usage: $0 [-jmx] [-jmxport <num>] [-debug] [-debugsuspend] [-debugport <num>] [-start [<console port>]] [-stop] [-status] [-console] [-help] [-agentpath:<path to lib>] [<other args will automatically be used for the JVM>]"
     exit 1
 }
 
@@ -83,6 +83,7 @@ statusdaemon=0
 consolestart=1
 dohelp=0
 extraJVMOpts=""
+agentPath=""
 unknown_option=0
 while true ; do
     case "$1" in
@@ -98,6 +99,7 @@ while true ; do
         -help) dohelp=1; shift;;
         -D*) extraJVMOpts="${extraJVMOpts} $1"; shift;;
         -X*) extraJVMOpts="${extraJVMOpts} $1"; shift;;
+        -agentpath:*) agentPath="$1"; shift;;
         "") break ;;
         *) echo "Unknown option $1"; unknown_option=1; shift ;;
     esac
@@ -209,6 +211,7 @@ if [ "${startdaemon}" -eq 1 ]; then
         exit -1
     fi
     $JAVA_HOME/bin/java ${extraJVMOpts} \
+        ${agentPath} \
         -Djava.io.tmpdir="${iotmpdir}/work/tmp" \
         -Dosgi.install.area="${bdir}" \
         -Dosgi.configuration.area="${confarea}/configuration" \
@@ -227,6 +230,7 @@ elif [ "${consolestart}" -eq 1 ]; then
         exit -1
     fi
     $JAVA_HOME/bin/java ${extraJVMOpts} \
+        ${agentPath} \
         -Djava.io.tmpdir="${iotmpdir}/work/tmp" \
         -Dosgi.install.area="${bdir}" \
         -Dosgi.configuration.area="${confarea}/configuration" \