Path: blob/master/src/jdk.hotspot.agent/test/libproc/libproctest64.sh
41144 views
#!/bin/ksh12#3# Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.4# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.5#6# This code is free software; you can redistribute it and/or modify it7# under the terms of the GNU General Public License version 2 only, as8# published by the Free Software Foundation.9#10# This code is distributed in the hope that it will be useful, but WITHOUT11# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13# version 2 for more details (a copy is included in the LICENSE file that14# accompanied this code).15#16# You should have received a copy of the GNU General Public License version17# 2 along with this work; if not, write to the Free Software Foundation,18# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19#20# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21# or visit www.oracle.com if you need additional information or have any22# questions.23#24#2526# This script is used to run consistency check of Serviceabilty Agent27# after making any libproc.so changes. Prints "PASSED" or "FAILED" in28# standard output.2930usage() {31echo "usage: $0"32echo " set SA_JAVA to be the java executable from JDK 1.5"33exit 134}3536if [ "$1" == "-help" ]; then37usage38fi3940if [ "x$SA_JAVA" = "x" ]; then41SA_JAVA=java42fi4344STARTDIR=`dirname $0`4546# create java process with test case47tmp=/tmp/libproctest48rm -f $tmp49$SA_JAVA -d64 -classpath $STARTDIR LibprocTest > $tmp &50pid=$!51while [ ! -s $tmp ] ; do52# Kludge alert!53sleep 254done5556# dump core57gcore $pid58kill -9 $pid5960# run libproc client61$SA_JAVA -d64 -showversion -cp $STARTDIR/../../build/classes::$STARTDIR/../sa.jar:$STARTDIR LibprocClient x core.$pid6263# delete core64rm -f core.$pid656667