165 166 client_available=`${JAVA} ${TESTVMOPTS} -client -Xinternalversion 2>&1 | \ 167 grep -c Client` 168 server_available=`${JAVA} ${TESTVMOPTS} -server -Xinternalversion 2>&1 | \ 169 grep -c Server` 170 is_tiered=`${JAVA} ${TESTVMOPTS} -XX:+PrintFlagsFinal -version | \ 171 grep TieredCompilation | \ 172 grep -c true` 173 # CompLevel_simple -- C1 174 client_level=1 175 # CompLevel_full_optimization -- C2 or Shark 176 server_level=4 177 178 echo "client_available=$client_available" 179 echo "server_available=$server_available" 180 echo "is_tiered=$is_tiered" 181 182 # crash vm in compiler thread with generation replay data and 'small' dump-file 183 # $@ - additional vm opts 184 generate_replay() { 185 # enable core dump 186 ulimit -c unlimited 187 188 cmd="${JAVA} ${TESTVMOPTS} $@ \ 189 -Xms8m \ 190 -Xmx32m \ 191 -XX:MetaspaceSize=4m \ 192 -XX:MaxMetaspaceSize=16m \ 193 -XX:InitialCodeCacheSize=512k \ 194 -XX:ReservedCodeCacheSize=4m \ 195 -XX:ThreadStackSize=512 \ 196 -XX:VMThreadStackSize=512 \ 197 -XX:CompilerThreadStackSize=512 \ 198 -XX:ParallelGCThreads=1 \ 199 -XX:CICompilerCount=1 \ 200 -Xcomp \ 201 -XX:CICrashAt=1 \ 202 -XX:+CreateMinidumpOnCrash \ 203 -XX:+DumpReplayDataOnError \ 204 -XX:ReplayDataFile=${replay_data} \ 205 -version" 206 echo GENERATION OF REPLAY.TXT: 207 echo $cmd 208 209 ${cmd} 2>&1 > crash.out 210 211 core_locations=`grep -i core crash.out | grep "location:" | \ 212 sed -e 's/.*location: //'` 213 rm crash.out 214 # processing core locations for *nix 215 if [ $OS != "windows" ] 216 then 217 # remove 'or' between '/core.<pid>' and 'core' 218 core_locations=`echo $core_locations | \ 219 sed -e 's/\([^ ]*\) or \([^ ]*\)/\1 \2/'` 220 # add <core_path>/core.<pid> core.<pid> 221 core=`echo $core_locations | awk '{print $1}'` 222 dir=`dirname $core` 223 core=`basename $core` 224 if [ -n ${core} ] 225 then 226 core_locations="$core_locations $dir${FS}$core" 227 fi 228 core=`echo $core_locations | awk '{print $2}'` 229 if [ -n ${core} ] 230 then 231 core_locations="$core_locations $dir${FS}$core" 232 fi 233 fi 234 235 echo "LOOKING FOR CORE IN ${core_locations}" 236 for core in $core_locations 237 do 238 if [ -r "$core" ] 239 then 240 core_file=$core 241 fi 242 done 243 244 # core-file was found 245 if [ -n "$core_file" ] 246 then 247 ${MV} "${core_file}" test_core 248 core_file=test_core 249 fi 250 251 ${RM} -f hs_err_pid*.log | 165 166 client_available=`${JAVA} ${TESTVMOPTS} -client -Xinternalversion 2>&1 | \ 167 grep -c Client` 168 server_available=`${JAVA} ${TESTVMOPTS} -server -Xinternalversion 2>&1 | \ 169 grep -c Server` 170 is_tiered=`${JAVA} ${TESTVMOPTS} -XX:+PrintFlagsFinal -version | \ 171 grep TieredCompilation | \ 172 grep -c true` 173 # CompLevel_simple -- C1 174 client_level=1 175 # CompLevel_full_optimization -- C2 or Shark 176 server_level=4 177 178 echo "client_available=$client_available" 179 echo "server_available=$server_available" 180 echo "is_tiered=$is_tiered" 181 182 # crash vm in compiler thread with generation replay data and 'small' dump-file 183 # $@ - additional vm opts 184 generate_replay() { 185 if [ $VM_OS != "windows" ] 186 then 187 # enable core dump 188 ulimit -c unlimited 189 fi 190 191 cmd="${JAVA} ${TESTVMOPTS} $@ \ 192 -Xms8m \ 193 -Xmx32m \ 194 -XX:MetaspaceSize=4m \ 195 -XX:MaxMetaspaceSize=16m \ 196 -XX:InitialCodeCacheSize=512k \ 197 -XX:ReservedCodeCacheSize=4m \ 198 -XX:ThreadStackSize=512 \ 199 -XX:VMThreadStackSize=512 \ 200 -XX:CompilerThreadStackSize=512 \ 201 -XX:ParallelGCThreads=1 \ 202 -XX:CICompilerCount=1 \ 203 -Xcomp \ 204 -XX:CICrashAt=1 \ 205 -XX:+CreateMinidumpOnCrash \ 206 -XX:+DumpReplayDataOnError \ 207 -XX:ReplayDataFile=${replay_data} \ 208 -version" 209 echo GENERATION OF REPLAY.TXT: 210 echo $cmd 211 212 ${cmd} 2>&1 > crash.out 213 214 core_locations=`grep -i core crash.out | grep "location:" | \ 215 sed -e 's/.*location: //'` 216 rm crash.out 217 # processing core locations for *nix 218 if [ $VM_OS != "windows" ] 219 then 220 # remove 'or' between '/core.<pid>' and 'core' 221 core_locations=`echo $core_locations | \ 222 sed -e 's/\([^ ]*\) or \([^ ]*\)/\1 \2/'` 223 # add <core_path>/core.<pid> core.<pid> 224 core_with_dir=`echo $core_locations | awk '{print $1}'` 225 dir=`dirname $core_with_dir` 226 core_with_pid=`echo $core_locations | awk '{print $2}'` 227 if [ -n ${core_with_pid} ] 228 then 229 core_locations="$core_locations $dir${FS}$core_with_pid $core_with_pid" 230 fi 231 fi 232 233 echo "LOOKING FOR CORE IN ${core_locations}" 234 for core in $core_locations 235 do 236 if [ -r "$core" ] 237 then 238 core_file=$core 239 fi 240 done 241 242 # core-file was found 243 if [ -n "$core_file" ] 244 then 245 ${MV} "${core_file}" test_core 246 core_file=test_core 247 fi 248 249 ${RM} -f hs_err_pid*.log |