Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/sun/tools/jinfo/Basic.sh
38841 views
#!/bin/sh1#2# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved.3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4#5# This code is free software; you can redistribute it and/or modify it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.22#232425# @test26# @bug 640276627# @summary Unit test for jinfo utility28#29# @library ../common30# @build SimpleApplication ShutdownSimpleApplication31# @run shell Basic.sh3233. ${TESTSRC}/../common/CommonSetup.sh34. ${TESTSRC}/../common/ApplicationSetup.sh3536# Start application and use PORTFILE for coordination37PORTFILE="${TESTCLASSES}"/shutdown.port38startApplication SimpleApplication "${PORTFILE}"3940# all return statuses are checked in this test41set +e4243failed=04445runSA=true4647if [ $isMacos = true -o $isAIX = true -o `uname -m` = ppc64 ]; then48runSA=false49fi5051if [ $isLinux = true ]; then52# Some Linux systems disable non-child ptrace (see 7050524)53ptrace_scope=`/sbin/sysctl -n kernel.yama.ptrace_scope`54if [ $? = 0 ]; then55if [ $ptrace_scope = 1 ]; then56runSA=false57fi58fi59fi6061if [ $runSA = true ]; then62# -sysprops option63${JINFO} -J-XX:+UsePerfData -sysprops $appJavaPid64if [ $? != 0 ]; then failed=1; fi6566# -flags option67${JINFO} -J-XX:+UsePerfData -flags $appJavaPid68if [ $? != 0 ]; then failed=1; fi6970# no option71${JINFO} -J-XX:+UsePerfData $appJavaPid72if [ $? != 0 ]; then failed=1; fi7374fi757677# -flag option78${JINFO} -J-XX:+UsePerfData -flag +PrintGC $appJavaPid79if [ $? != 0 ]; then failed=1; fi8081${JINFO} -J-XX:+UsePerfData -flag -PrintGC $appJavaPid82if [ $? != 0 ]; then failed=1; fi8384${JINFO} -J-XX:+UsePerfData -flag PrintGC $appJavaPid85if [ $? != 0 ]; then failed=1; fi8687if $isSolaris; then8889${JINFO} -J-XX:+UsePerfData -flag +ExtendedDTraceProbes $appJavaPid90if [ $? != 0 ]; then failed=1; fi9192${JINFO} -J-XX:+UsePerfData -flag -ExtendedDTraceProbes $appJavaPid93if [ $? != 0 ]; then failed=1; fi9495${JINFO} -J-XX:+UsePerfData -flag ExtendedDTraceProbes $appJavaPid96if [ $? != 0 ]; then failed=1; fi9798fi99100set -e101102stopApplication "${PORTFILE}"103waitForApplication104105exit $failed106107108