You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tdk-dev@turbine.apache.org by jv...@apache.org on 2001/05/23 19:05:24 UTC

cvs commit: jakarta-turbine-tdk/src/bin catalina-oi.sh

jvanzyl     01/05/23 10:05:23

  Added:       src/bin  catalina-oi.sh
  Log:
  - script for running catalina/turbine under optimize it for
    profiling info.
  
  Revision  Changes    Path
  1.1                  jakarta-turbine-tdk/src/bin/catalina-oi.sh
  
  Index: catalina-oi.sh
  ===================================================================
  #!/bin/sh
  # This script allows to start Jakarta Catalina for profiling with OptimizeIt
  # It should only be executed from Tomcat's bin directory
  # Refer to the tutorial ProfilingTomcat.html for more information
  # (Tutorials can be accessed from the Info/Tutorials menu in OptimizeIt) 
  
  #This should contain the path to the directory of the vm that should be used
  JAVAHOME=${JAVA_HOME}
  
  #This is the path to OptimizeIt directory
  OPTITDIR=${OPTIMIZE_IT_HOME}
  
  # This is the path to the Catalina directory, .. 
  # if you are starting the script from the bin directory
  CATALINA_HOME=.
  
  # Uncomment this line if your vm uses green threads
  #JAVATHREADS="-green -DOPTITTHR=green"
  
  #Increase the GCOP value if you get some "GCOP buffer too small" errors
  #(size is in Mb)
  GCOPSIZE=1
  
  #Port number used by OptimizeIt (1470 is default)
  PORT=1470
  
  #Uncomment this line if you want to disable memory profiler
  #OPTIONS="-dmp"
  
  #Uncomment this line if you use OptimizeIt's API
  #Warning! Selecting this option will disable OptimizeIt's memory and CPU profiler
  #Don't use that option unless you call OptimizeIt's API from your code
  #OPTIONS="-enableAPI $OPTIONS"
  
  #Add any extra classpath here
  EXTRACLASSPATH=
  
  #Here you can explicitely specify the library OptimizeIt should load, 
  #if it does not automatically load the right one.
  #Use that property only if the script does not start Tomcat correctly.
  #Values are: with JDK 1.1 -> 11, with JDK 1.1.8 production release -> 118pr, with JDK 1.2 -> 12, 
  #with JDK 1.3 and IBM JDK 1.2 and 1.3 -> jni
  #AUDIT=13
  
  # ** You should not have to modify anything below this line **
  # --------------------------------------------------------------------------------
  
  if [ ! -d "$JAVAHOME" ] ; then
  echo "The JAVAHOME specified $JAVAHOME does not exists."
  echo "Make sure to specify a correct JAVAHOME in the startTomcatWithOptimizeIt.sh script."
  exit
  fi
  
  if [ -f $JAVAHOME/bin/java ]
  then
  JAVA=$JAVAHOME/bin/java
  elif [ -f $JAVAHOME/bin/jre ]
  then
  JAVA=$JAVAHOME/bin/jre
  else
  echo "No java or jre found under the directory $JAVAHOME"
  echo "Make sure to specify a correct JAVAHOME in the startTomcatWithOptimizeIt.sh script."
  exit
  fi
  
  if [ ! -f "$OPTITDIR/lib/optit.jar" ] ; then
  echo "Cannot find the OptimizeIt library optit.jar under the directory $OPTITDIR"
  echo "Make sure to specify a correct OPTITDIR in the startTomcatWithOptimizeIt.sh script."
  exit
  fi
  LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-.}:${OPTITDIR}/lib
  export LD_LIBRARY_PATH
  OI_PATH=$PATH
  export OI_PATH
  
  if [ -z "$AUDIT" ] ; then
  AUDIT=`$OPTITDIR/runtime/bin/jre -classpath "$OPTITDIR/runtime/lib/rt.jar:$CLASSPATH:$OPTITDIR/lib/optit.jar" intuitive.optit.fileop.JavaTester $JAVA 2> /dev/null`
  fi
  
  if [ -z "$JAVATHREADS" ] ; then
  JAVATHREADS="-native -DOPTITTHR=native"
  fi
  
  case $AUDIT in
    "11") 
      COMMAND="$JAVA $JAVATHREADS -noclassgc -Djava.compiler=NONE -DAUDIT=11 -DOPTITDIR=$OPTITDIR"
      JAVACLASSPATH="$JAVAHOME/lib/classes.zip";;
  
    "118pr") 
      COMMAND="$JAVA $JAVATHREADS -noclassgc -Djava.compiler=NONE -DAUDIT=118pr -DOPTITDIR=$OPTITDIR"
      JAVACLASSPATH="$JAVAHOME/lib/classes.zip";;
  
    "12") 
      COMMAND="$JAVA $JAVATHREADS -Xrunoii -Xnoclassgc -Djava.compiler=NONE -DAUDIT=12 -DOPTITDIR=$OPTITDIR"
      JAVACLASSPATH="" ;;
  
    "JNI") 
      COMMAND="$JAVA -classic -Xrunoii -DAUDIT=jni"
      JAVACLASSPATH="" ;;
  
    *) echo "Virtual machine not recognized, using AUDIT JNI"
       echo "(you can change the library used by editing the AUDIT property in the script file startTomcatWithOptimizeIt.sh)"
       COMMAND="$JAVA -classic -Xrunoii -DAUDIT=jni"
       JAVACLASSPATH="" ;;
  esac
  
  JAVACLASSPATH=.:${JAVACLASSPATH}:${OPTITDIR}/lib/optit.jar:${CATALINA_HOME}/classes:${JAVAHOME}/lib/tools.jar:${EXTRACLASSPATH}
  
  for fich in ${CATALINA_HOME}/lib/*
  do
    JAVACLASSPATH=${JAVACLASSPATH}:$fich
  done
  
  # Add catalina's bootstrap.jar
  JAVACLASSPATH=${JAVACLASSPATH}:${CATALINA_HOME}/bin/bootstrap.jar
  
  echo "$COMMAND -Dcatalina.home=${CATALINA_HOME} -DOPTITDIR=${OPTITDIR} -classpath $JAVACLASSPATH intuitive.audit.Audit -port $PORT $OPTIONS org.apache.catalina.startup.Bootstrap $@"
  
  $COMMAND -Dcatalina.home=${CATALINA_HOME} -DOPTITDIR=${OPTITDIR} -classpath $JAVACLASSPATH intuitive.audit.Audit -port $PORT $OPTIONS org.apache.catalina.startup.Bootstrap $@
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-tdk-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-tdk-dev-help@jakarta.apache.org