Skip to content

Commit

Permalink
Merge pull request #17 from judovana/lessLogsViaRunsh
Browse files Browse the repository at this point in the history
No more log duplication via run.sh
  • Loading branch information
judovana authored Feb 27, 2024
2 parents a8184e8 + 1a5790d commit cd2690f
Showing 1 changed file with 33 additions and 35 deletions.
68 changes: 33 additions & 35 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ done
readonly CH_SCRIPT_DIR="$( cd -P "$( dirname "$SCRIPT_SOURCE" )" && pwd )"
set -ex

function ljava() {
if [ "x$JAVA_HOME" != "x" ]; then
LJAVA=${JAVA_HOME}/bin/java
LJAR=${JAVA_HOME}/bin/jar
LJAVAC=${JAVA_HOME}/bin/javac
echo "use java from JAVA_HOME [${LJAVA}]"
echo "use javac from JAVA_HOME [${LJAVAC}]"
elif [ $( which java ) ]; then
LJAVA=$( which java )
LJAR=$( which jar )
LJAVAC=$( which javac )
echo "use java from PATH [${LJAVA}]"
echo "use java from PATH [${LJAVAC}]"
else
echo "no java found!"
LJAVA=java
LJAR=jar
LJAVAC=javac
fi
}

GC=${1}
if [ "x$GC" == "x" ] ; then
#todo add generational zgc since jdk21, todo add generational shenandoah sicnce jdk23?
Expand Down Expand Up @@ -54,10 +75,12 @@ if [ "x$GC" == "x" ] ; then
fi

if [ ! "x$STAMP" == "x" ] ; then
ljava
arch=`uname -m | sed "s/[^a-zA-Z0-9_]//g"`
os=`uname -o | sed "s/[^a-zA-Z0-9_]//g"`
jdk=`${LJAVA} -version 2>&1 | head -n1 | sed -E "s/[^0-9]+/-/g"`
time=`date +%s`
STAMP="-${os}_${arch}_${time}"
STAMP="-${os}_${arch}_jdk${jdk}_${time}"
fi
# churn parameters sane defaults
if [ "x$HEAPSIZE" == "x" ] ; then
Expand All @@ -84,27 +107,6 @@ if [ "x$BLOCKS" == "x" ] ; then
BLOCKS=16
fi

function ljava() {
if [ "x$JAVA_HOME" != "x" ]; then
LJAVA=${JAVA_HOME}/bin/java
LJAR=${JAVA_HOME}/bin/jar
LJAVAC=${JAVA_HOME}/bin/javac
echo "use java from JAVA_HOME [${LJAVA}]"
echo "use javac from JAVA_HOME [${LJAVAC}]"
elif [ $( which java ) ]; then
LJAVA=$( which java )
LJAR=$( which jar )
LJAVAC=$( which javac )
echo "use java from PATH [${LJAVA}]"
echo "use java from PATH [${LJAVAC}]"
else
echo "no java found!"
LJAVA=java
LJAR=jar
LJAVAC=javac
fi
}

if [ ! -e ${CH_SCRIPT_DIR}/target ] ; then
if which mvn ; then
if [ "x$MVOPTS" == "x" ] ; then
Expand Down Expand Up @@ -185,20 +187,16 @@ popd
fi
) || true

if [ `readlink -f ${CH_SCRIPT_DIR}` == `pwd` ] ; then
if [ 0$gclogsCount -gt 0 ] ; then
rm -v ${CH_SCRIPT_DIR}/outlog* ${CH_SCRIPT_DIR}/gclog-*
else
rm -v ${CH_SCRIPT_DIR}/outlog-*
fi
else

#the logs are already packed
if [ 0$gclogsCount -gt 0 ] ; then
rm -v ${CH_SCRIPT_DIR}/outlog* ${CH_SCRIPT_DIR}/gclog-*
else
rm -v ${CH_SCRIPT_DIR}/outlog-*
fi
if [ ! `readlink -f ${CH_SCRIPT_DIR}` == `pwd` ] ; then
if [ 0$gclogsCount -gt 0 ] ; then
mv -v ${CH_SCRIPT_DIR}/gclogs${NOCOMP}${STAMP}.tar.gz ${CH_SCRIPT_DIR}/outlog-* ${CH_SCRIPT_DIR}/gclog-* .
else
mv -v ${CH_SCRIPT_DIR}/gclogs${NOCOMP}${STAMP}.tar.gz ${CH_SCRIPT_DIR}/outlog-* .
fi
if [ -e ${CH_SCRIPT_DIR}/churn${NOCOMP}${STAMP}.jtr.xml.gz ] ; then
mv -v ${CH_SCRIPT_DIR}/churn${NOCOMP}${STAMP}.jtr.xml.gz .
mv -v ${CH_SCRIPT_DIR}/gclogs${NOCOMP}${STAMP}.tar.gz .
fi
fi

Expand Down

0 comments on commit cd2690f

Please sign in to comment.