Skip to content

Commit

Permalink
get.sh: allow tarball extraction with Solaris tar (#2039)
Browse files Browse the repository at this point in the history
* get.sh: allow tarball extraction with Solaris tar

Signed-off-by: Stewart X Addison <sxa@redhat.com>

* maketest.sh: invoke gmake instead of make on Solaris

Signed-off-by: Stewart X Addison <sxa@redhat.com>

* stop using -n on head/tail

Signed-off-by: Stewart X Addison <sxa@redhat.com>

* build.xml: avoid using -C on tar extracts

Signed-off-by: Stewart X Addison <sxa@redhat.com>

* Use jtregTar variable

Signed-off-by: Stewart X Addison <sxa@redhat.com>
  • Loading branch information
sxa authored Nov 18, 2020
1 parent 1f5d71c commit 5060e16
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion functional/SyntheticGCWorkload/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ VM_OPTIONS_BASE="$5"
# Try to list configuration versions of the requested size.
CONFIG_VERSIONS="`ls "$CONFIG_DIR"/"config_""$SIZE""_"*".xml"`" || exit 4
# Pick the last one.
CONFIG="`ls $CONFIG_VERSIONS | sort -n | tail -n 1`"
CONFIG="`ls $CONFIG_VERSIONS | sort -n | tail -1`"
# Get the name of the configuration
CONFIG_NAME="${CONFIG##*/}"
#######################################
Expand Down
2 changes: 1 addition & 1 deletion get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ getBinaryOpenjdk()
cd ./tmp
pax -p xam -rzf ../$jar_name
else
gzip -cd $jar_name | tar xof - -C ./tmp
gzip -cd $jar_name | (cd tmp && tar xof -)
fi

cd $SDKDIR/openjdkbinary/tmp
Expand Down
2 changes: 1 addition & 1 deletion maketest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# limitations under the License.
######
case `uname` in
AIX | *BSD )
AIX | SunOS | *BSD )
MAKE=gmake
;;
*)
Expand Down
10 changes: 5 additions & 5 deletions openjdk/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@
</else>
</if>
<exec executable="gzip" failonerror="true">
<arg line="-d ${jtregTar}.gz" />
</exec>
<arg line="-d ${jtregTar}.gz" /> </exec>
</then>
</if>
<if>
<contains string="${SPEC}" substring="zos" />
<then>
<exec executable="tar" failonerror="true">
<arg line="xfo ${jtregTar} -C ${DEST}" />
<arg line="xfo ${jtregTar}" />
</exec>
</then>
<else>
<exec executable="tar" failonerror="true">
<arg line="xf ${jtregTar} -C ${DEST}" />
<exec executable="sh" failonerror="true">
<arg line="-c 'cat ${jtregTar} | (cd ${DEST} &amp;&amp; tar xof -)'" />

</exec>
</else>
</if>
Expand Down
4 changes: 2 additions & 2 deletions perf/affinity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -593,15 +593,15 @@ function __init_cpus_aix() {
# add the nodes to an array
__AFFINITY_NUMA_NODE_ARR=()
for (( i=0; i<$__AFFINITY_NUMA_NODES; i++ )); do
local numa_node=$(lssrad -vs $i | tail -n 1 | awk '{print $4}')
local numa_node=$(lssrad -vs $i | tail -1 | awk '{print $4}')
__AFFINITY_NUMA_NODE_ARR+=($numa_node)
done

# total number of physical cores
local phys_cpus_count=$(lsdev -Cc processor | grep Available | wc -l)

# get total number of cpus
local cpu_max=$(bindprocessor -q | tr ' ' '\n' | tail -n 1)
local cpu_max=$(bindprocessor -q | tr ' ' '\n' | tail -1)
__AFFINITY_CPUS=$(expr $cpu_max + 1)

# get threads per core
Expand Down
40 changes: 20 additions & 20 deletions perf/liberty/scripts/bin/common_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ platformSpecificSetup()
echo "CLIENT = $CLIENT"
echo "DB_MACHINE = $DB_MACHINE"
echo "LIBERTY_HOST = $LIBERTY_HOST"
CLIENT=`nslookup $CLIENT | grep Address | tail -n 1 | cut -d' ' -f3`
DB_MACHINE=`nslookup $DB_MACHINE | grep Address | tail -n 1 | cut -d' ' -f3`
LIBERTY_HOST=`nslookup $LIBERTY_HOST | grep Address | tail -n 1 | cut -d' ' -f3`
RESULTS_MACHINE=`nslookup $RESULTS_MACHINE | grep Address | tail -n 1 | cut -d' ' -f3`
CLIENT=`nslookup $CLIENT | grep Address | tail -1 | cut -d' ' -f3`
DB_MACHINE=`nslookup $DB_MACHINE | grep Address | tail -1 | cut -d' ' -f3`
LIBERTY_HOST=`nslookup $LIBERTY_HOST | grep Address | tail -1 | cut -d' ' -f3`
RESULTS_MACHINE=`nslookup $RESULTS_MACHINE | grep Address | tail -1 | cut -d' ' -f3`
echo "CLIENT = $CLIENT"
echo "DB_MACHINE = $DB_MACHINE"
echo "LIBERTY_HOST = $LIBERTY_HOST"
Expand Down Expand Up @@ -645,20 +645,20 @@ calculateFootprint()
# add footprint collection to end of Liberty throughput - this is a cut+paste from sufpdt.sh
case ${PLATFORM} in
CYGWIN)
# FULL_MEM=`pslist -m ${WINDOWS_PID} | tail -n 2`
# FULL_MEM=`pslist -m ${WINDOWS_PID} | tail -2`
# echo "${FULL_MEM}"
# uncomment this line if reporting on pslist throughput
# FOOTPRINT=`echo "${FULL_MEM}" | tail -n 1 | awk '{ print $4 }'`
# FOOTPRINT=`echo "${FULL_MEM}" | tail -1 | awk '{ print $4 }'`
if [ -z ${WINDOWS_PID} ]; then
echo "No windows PID - not running footprint tool"
else
echo "vmmap output:"
vmmap -64 -PID ${WINDOWS_PID} vmmap.out
local VMMAP_MEM=`head -n 15 vmmap.out`
local VMMAP_MEM=`head -15 vmmap.out`
echo "${VMMAP_MEM}"
rm vmmap.out

local FOOTPRINT=`echo "${VMMAP_MEM}" | head -n 5 | tail -n 1 | awk '{print $5}' | sed "s/,//g"`
local FOOTPRINT=`echo "${VMMAP_MEM}" | head -5 | tail -1 | awk '{print $5}' | sed "s/,//g"`

echo ""

Expand All @@ -671,10 +671,10 @@ calculateFootprint()
do
local tmpWINDOWS_PID=`ps -W | grep java | grep ${PID} | grep -v grep | awk '{ print $4 }'`
vmmap -64 -PID ${tmpWINDOWS_PID} tmpvmmap.out
local tmpVMMAP_MEM=`head -n 15 tmpvmmap.out`
local tmpVMMAP_MEM=`head -15 tmpvmmap.out`
echo "${tmpVMMAP_MEM}"
rm tmpvmmap.out
local tmpFOOTPRINT=`echo "${VMMAP_MEM}" | head -n 5 | tail -n 1 | awk '{print $5}' | sed "s/,//"`
local tmpFOOTPRINT=`echo "${VMMAP_MEM}" | head -5 | tail -1 | awk '{print $5}' | sed "s/,//"`
local tmpProcName=`ps -W |grep ${PID}| grep -v 'grep'|grep -v 'ws-server.jar'`

#some logic should go here
Expand Down Expand Up @@ -719,8 +719,8 @@ calculateFootprint()
# now find the footprint figure from the awk output
local FOOTPRINT=`awk '/JTC footprint/ { print $8 }' footprintAwk.tmp`
# TODO: Once verified, remove variables not used
#local free=`vmstat -l | sed -e 's/ */ /g' |tr ' ' '\n' | tail -n 1 | tail -c 10`
#active=`vmstat -l | sed -e 's/ */ /g' |tr ' ' '\n' | tail -n 2 | head -n 1| tail -c 10`
#local free=`vmstat -l | sed -e 's/ */ /g' |tr ' ' '\n' | tail -1 | tail -c 10`
#active=`vmstat -l | sed -e 's/ */ /g' |tr ' ' '\n' | tail -2 | head -1| tail -c 10`

if [ "$SCENARIO" = "Cognos" ]; then
local running_total=$FOOTPRINT
Expand All @@ -737,7 +737,7 @@ calculateFootprint()
cat footprintAwk.tmp >> ${BENCHMARK_DIR}/tmp/${PID}.footprint.out
local tmpFOOTPRINT=`awk '/JTC footprint/ { print $8 }' footprintAwk.tmp`
# TODO: Once verified, remove variables not used
# local tmpfree=`vmstat -l | sed -e 's/ */ /g' |tr ' ' '\n' | tail -n 1 | tail -c 10`
# local tmpfree=`vmstat -l | sed -e 's/ */ /g' |tr ' ' '\n' | tail -1 | tail -c 10`
#ps -ef -o pid,comm,args| grep ${PID} | grep -v 'grep'
local tmpProcName=`ps -ef -o pid,comm,args |grep ${PID}| grep -v 'grep'|grep -v 'ws-server.jar'`

Expand Down Expand Up @@ -805,11 +805,11 @@ calculateFootprint()
;;

*)
local FOOTPRINT=`ps -p ${SERVER_PID} -o rss,vsz,comm,pid | tail -n 1 | awk '{ print $1 }'`
local HPTOTAL=`cat /proc/meminfo | grep ^HugePages_Total | sed 's/HugePages.*: *//g' | head -n 1`
local HPFREE=`cat /proc/meminfo | grep ^HugePages_Free | sed 's/HugePages.*: *//g' | head -n 2 | tail -n 1`
local FOOTPRINT=`ps -p ${SERVER_PID} -o rss,vsz,comm,pid | tail -1 | awk '{ print $1 }'`
local HPTOTAL=`cat /proc/meminfo | grep ^HugePages_Total | sed 's/HugePages.*: *//g' | head -1`
local HPFREE=`cat /proc/meminfo | grep ^HugePages_Free | sed 's/HugePages.*: *//g' | head -2 | tail -1`
# Once verified, confirm that HPRESVD is not used anywhere
local HPRESVD=`cat /proc/meminfo | grep ^HugePages_Rsvd | sed 's/HugePages.*: *//g' | head -n 3 | tail -n 1`
local HPRESVD=`cat /proc/meminfo | grep ^HugePages_Rsvd | sed 's/HugePages.*: *//g' | head -3 | tail -1`
local HPINUSE
let HPINUSE=$HPTOTAL-$HPFREE-$HPPREINUSE
echo "HPs in use by liberty: "${HPINUSE}
Expand All @@ -823,7 +823,7 @@ calculateFootprint()
local Other_PIDS=`ps -o pid,comm,args |grep 'jre/bin/java'|grep -v 'grep'| grep -v 'ws-server.jar'|awk '{print $1}'`
for PID in $Other_PIDS
do
local tmpFOOTPRINT=`ps -p ${PID} -o rss,vsz,comm,pid | tail -n 1 | awk '{ print $1 }'`
local tmpFOOTPRINT=`ps -p ${PID} -o rss,vsz,comm,pid | tail -1 | awk '{ print $1 }'`
#ps -o pid,comm,args| grep ${PID} | grep -v 'grep'
local tmpProcName=`ps -o pid,comm,args |grep ${PID}| grep -v 'grep'|grep -v 'ws-server.jar'`
#some logic should go here
Expand Down Expand Up @@ -954,8 +954,8 @@ getPreBenchmarkHugePagesInUse()
"
case ${PLATFORM} in
Linux)
local HPPRETOTAL=`cat /proc/meminfo | grep HugePages_Total | sed 's/HugePages.*: *//g' | head -n 1`
local HPPREFREE=`cat /proc/meminfo | grep HugePages_Free | sed 's/HugePages.*: *//g' | head -n 2|tail -n 1`
local HPPRETOTAL=`cat /proc/meminfo | grep HugePages_Total | sed 's/HugePages.*: *//g' | head -1`
local HPPREFREE=`cat /proc/meminfo | grep HugePages_Free | sed 's/HugePages.*: *//g' | head -2 | tail -1`
let HPPREINUSE=$HPPRETOTAL-$HPPREFREE
echo "HP IN USE : " ${HPPREINUSE}
;;
Expand Down
2 changes: 1 addition & 1 deletion perf/liberty/scripts/bin/database_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ configureDB()
#of now, we'll be okay since it's the same service.properties file for both startup and throughput. Once we run
#other apps, then this needs to be updated.

DB_FILE=`find ${LIBERTY_DIR} -name 'service.properties' | grep service.properties | head -n 1`
DB_FILE=`find ${LIBERTY_DIR} -name 'service.properties' | grep service.properties | head -1`

if [ ! -z "${DB_FILE}" ]; then
echo "DB_FILE=${DB_FILE} exists! No need to configure database"
Expand Down
2 changes: 1 addition & 1 deletion perf/liberty/scripts/bin/sufp_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ startupFootprint()
local ServletSU=${SUTime}
calcTime "${SERVER_DIR}/logs/${TRACE_FILE}" ${LIBERTY_START_TIME} "EJB_500" ${SERVER_NAME} NoPrint
local HugeEJBSU=${SUTime}
local max=`echo "${ServletSU}\n${HugeEJB}"|sort -n|tail -n 1`
local max=`echo "${ServletSU}\n${HugeEJB}" | sort -n | tail -1`
echo "HugeEJB: ${HugeEJBSU}"
echo "ServletSU: ${ServletSU}"
echo "Startup time: ${max}"
Expand Down
2 changes: 1 addition & 1 deletion perf/liberty/scripts/bin/throughput_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,7 @@ echoAndRunCmd "sleep 10"
###############

if [ "$PLATFORM" = "OS/390" ]; then
NUM_CPUS=`oeconsol "d m=cpu" | grep '[0-9][0-9A-F] +' | tail -n 1 | awk '{print ($1 + 1)}'`
NUM_CPUS=`oeconsol "d m=cpu" | grep '[0-9][0-9A-F] +' | tail -1 | awk '{print ($1 + 1)}'`
echo "AppServer is running with $NUM_CPUS CPUs online"
restartRMF ${MAX_CLIENT_WAIT}
fi
Expand Down
4 changes: 2 additions & 2 deletions perf/liberty/scripts/resource/client_scripts/cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ echo "<data runType=\"${TYPE}\" runNo=\"${NUM}\" machine=\"${CLIENT}\" os=\"${CL
# bash: /home/jbench/echo \<data runType="" runNo="" machine="" \> >/java/perffarm/liberty-cleaned/testfile_2.txt 2>&1 & wait: No such file or directory
case $NET_PROTOCOL in
"STAF")
STAF ${WAS_HOST} PROCESS START SHELL COMMAND "echo ${WAS_TAG_STRING}<data runType=${WAS_PATCH_STRING}${TYPE}${WAS_PATCH_STRING} runNo=${WAS_PATCH_STRING}${NUM}${WAS_PATCH_STRING} machine=${WAS_PATCH_STRING}${WAS_HOST}${WAS_PATCH_STRING} os=${WAS_PATCH_STRING}`STAF ${WAS_HOST} VAR GET SYSTEM VAR STAF/Config/OS/Name | tail -n 1`${WAS_PATCH_STRING}${WAS_TAG_STRING}>" WAIT STDERRTOSTDOUT STDOUTAPPEND ${SERVER_WORKDIR}/${SERVER_CPU_RESULTS}
STAF ${WAS_HOST} PROCESS START SHELL COMMAND "echo ${WAS_TAG_STRING}<data runType=${WAS_PATCH_STRING}${TYPE}${WAS_PATCH_STRING} runNo=${WAS_PATCH_STRING}${NUM}${WAS_PATCH_STRING} machine=${WAS_PATCH_STRING}${WAS_HOST}${WAS_PATCH_STRING} os=${WAS_PATCH_STRING}`STAF ${WAS_HOST} VAR GET SYSTEM VAR STAF/Config/OS/Name | tail -1`${WAS_PATCH_STRING}${WAS_TAG_STRING}>" WAIT STDERRTOSTDOUT STDOUTAPPEND ${SERVER_WORKDIR}/${SERVER_CPU_RESULTS}
;;
"SSH")
ssh ${HOST_MACHINE_USER}@${WAS_HOST} exec -a cpu-measure "echo \<data runType=\\\"${TYPE}\\\" runNo=\\\"${NUM}\\\" machine=\\\"${WAS_HOST}\\\" os=\\\"${WAS_PLATFORM}\\\"\> >>${SERVER_WORKDIR}/${SERVER_CPU_RESULTS} 2>&1" & wait
Expand All @@ -346,7 +346,7 @@ esac
if [ -n "${DB_HOST}" ]; then
case $NET_PROTOCOL in
"STAF")
STAF ${DB_HOST} PROCESS START SHELL COMMAND "echo ${DB_TAG_STRING}<data runType=${DB_PATCH_STRING}${TYPE}${DB_PATCH_STRING} runNo=${DB_PATCH_STRING}${NUM}${DB_PATCH_STRING} machine=${DB_PATCH_STRING}${DB_HOST}${DB_PATCH_STRING} os=${DB_PATCH_STRING}`STAF ${DB_HOST} VAR GET SYSTEM VAR STAF/Config/OS/Name | tail -n 1`${DB_PATCH_STRING}${DB_TAG_STRING}>" WAIT STDERRTOSTDOUT STDOUTAPPEND ${DB_SERVER_WORKDIR}/${DB_CPU_RESULTS}
STAF ${DB_HOST} PROCESS START SHELL COMMAND "echo ${DB_TAG_STRING}<data runType=${DB_PATCH_STRING}${TYPE}${DB_PATCH_STRING} runNo=${DB_PATCH_STRING}${NUM}${DB_PATCH_STRING} machine=${DB_PATCH_STRING}${DB_HOST}${DB_PATCH_STRING} os=${DB_PATCH_STRING}`STAF ${DB_HOST} VAR GET SYSTEM VAR STAF/Config/OS/Name | tail -1`${DB_PATCH_STRING}${DB_TAG_STRING}>" WAIT STDERRTOSTDOUT STDOUTAPPEND ${DB_SERVER_WORKDIR}/${DB_CPU_RESULTS}
;;
"SSH")
ssh ${DB_MACHINE_USER}@${DB_HOST} exec -a cpu-measure "echo \<data runType=\\\"${TYPE}\\\" runNo=\\\"${NUM}\\\" machine=\\\"${DB_HOST}\\\" os=\\\"${DB_PLATFORM}\\\"\> >>${DB_SERVER_WORKDIR}/${DB_CPU_RESULTS} 2>&1" & wait
Expand Down
6 changes: 3 additions & 3 deletions perf/liberty/scripts/resource/client_scripts/trade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ JMS)
echo "Running $CLIENTS clients for $TIMELIMIT seconds..."
${JMETER_LOC} -n -t ${SCRIPT_JMeter} -p jmeter_nonssl.properties -JTHREADS=${CLIENTS} -JDURATION=$TIMELIMIT -JHOST=${WAS_HOST} -JPORT=9128 -JURL=JMSApp/2.0/P2P?ACTION=NonPersistent -JPAYLOAD=${PWD}/jms1KB >>resultstmp.txt
fi
summary=`cat resultstmp.txt|sed 's%<summary>%%g'|grep "summary = "|tail -n 1`
summary=`cat resultstmp.txt|sed 's%<summary>%%g'|grep "summary = "|tail -1`
throughput=`echo $summary|awk '{print $7}' | sed 's%/s%%g'`
responsetime=`echo $summary|awk '{print $9}' | sed 's%/s%%g'`
weberrors=`echo $summary|awk '{print $15}' | sed 's%/s%%g'`
Expand Down Expand Up @@ -90,7 +90,7 @@ DayTraderSSL | DayTrader7SSL)

for(( clientIterator=1; clientIterator<=${JMETER_INSTANCES}; clientIterator++ ))
do
summary=`cat client${clientIterator}.txt.tmp|sed 's%<summary>%%g'|grep "summary = "|tail -n 1`
summary=`cat client${clientIterator}.txt.tmp|sed 's%<summary>%%g'|grep "summary = "|tail -1`
throughput=`echo $summary|awk '{print $7}' | sed 's%/s%%g'`
responsetime=`echo $summary|awk '{print $9}' | sed 's%/s%%g'`
weberrors=`echo $summary|awk '{print $15}' | sed 's%/s%%g'`
Expand Down Expand Up @@ -128,7 +128,7 @@ DayTraderSSL | DayTrader7SSL)
${JMETER_LOC} -n -t ${SCRIPT_JMeter} -p jmeter_nonssl.properties -JTHREADS=${CLIENTS} -JDURATION=$TIMELIMIT -JHOST=${WAS_HOST} >>resultstmp.txt
fi

summary=`cat resultstmp.txt|sed 's%<summary>%%g'|grep "summary = "|tail -n 1`
summary=`cat resultstmp.txt|sed 's%<summary>%%g'|grep "summary = "|tail -1`
throughput=`echo $summary|awk '{print $7}' | sed 's%/s%%g'`
responsetime=`echo $summary|awk '{print $9}' | sed 's%/s%%g'`
weberrors=`echo $summary|awk '{print $15}' | sed 's%/s%%g'`
Expand Down

0 comments on commit 5060e16

Please sign in to comment.