hotspot/test/serviceability/7170638/SDTProbesGNULinuxTest.sh
author thartmann
Tue, 28 Oct 2014 16:44:39 +0100
changeset 27431 5f970b31939c
parent 13962 e9f98793dc26
permissions -rw-r--r--
8062250: [TESTBUG] compiler/codecache/CheckSegmentedCodeCache.java fails after CodeCacheMinimumFreeSpace removal Summary: Adapted calculation of minimum code cache size after CodeCacheMinimumFreeSpace was removed by JDK-8046809. Reviewed-by: kvn, anoll
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13962
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
     1
# 
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
     2
#  Copyright (c) 2012, Red Hat, Inc.
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
     3
#  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
     4
# 
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
     5
#  This code is free software; you can redistribute it and/or modify it
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
     6
#  under the terms of the GNU General Public License version 2 only, as
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
     7
#  published by the Free Software Foundation.
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
     8
# 
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
     9
#  This code is distributed in the hope that it will be useful, but WITHOUT
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    10
#  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    11
#  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    12
#  version 2 for more details (a copy is included in the LICENSE file that
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    13
#  accompanied this code).
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    14
# 
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    15
#  You should have received a copy of the GNU General Public License version
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    16
#  2 along with this work; if not, write to the Free Software Foundation,
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    17
#  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    18
# 
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    19
#  Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    20
#  or visit www.oracle.com if you need additional information or have any
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    21
#  questions.
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    22
# 
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    23
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    24
# @test SDTProbesGNULinuxTest.sh
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    25
# @bug 7170638
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    26
# @summary Test SDT probes available on GNU/Linux when DTRACE_ENABLED
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    27
# @run shell SDTProbesGNULinuxTest.sh
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    28
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    29
# This test only matters on GNU/Linux, others trivially PASS.
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    30
OS=`uname -s`
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    31
case "$OS" in
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    32
  Linux )
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    33
    ;;
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    34
  *)
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    35
    echo "Not testing on anything but GNU/Linux. PASSED"
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    36
    exit 0;
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    37
    ;;
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    38
esac
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    39
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    40
# Where is our java (parent) directory? 
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    41
if [ "${TESTJAVA}" = "" ]; then
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    42
  PARENT=$(dirname $(readlink -f $(which java)))
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    43
  TESTJAVA=`dirname ${PARENT}`
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    44
  echo "TESTJAVA directory not set, using " ${TESTJAVA}
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    45
fi
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    46
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    47
# This test only matters when build with DTRACE_ENABLED. 
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    48
${TESTJAVA}/bin/java -XX:+ExtendedDTraceProbes -version
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    49
if [ "$?" != "0" ]; then
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    50
  echo "Not build using DTRACE_ENABLED. PASSED"
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    51
  exit 0
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    52
fi
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    53
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    54
# Test all available libjvm.so variants
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    55
for libjvm in $(find ${TESTJAVA} -name libjvm.so); do
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    56
  echo "Testing ${libjvm}"
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    57
  # Check whether the SDT probes are compiled in.
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    58
  readelf -S ${libjvm} | grep '.note.stapsdt'
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    59
  if [ "$?" != "0" ]; then
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    60
    echo "Failed: ${libjvm} doesn't contain SDT probes."
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    61
    exit 1
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    62
  fi
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    63
  # We could iterate over all SDT probes and test them individually
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    64
  # with readelf -n, but older readelf versions don't understand them.
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    65
done
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    66
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    67
echo "Passed."
e9f98793dc26 8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff changeset
    68
exit 0