Mercurial > hg > truffle
annotate test/serviceability/7170638/SDTProbesGNULinuxTest.sh @ 18359:a3a2359ac88e
Support constant folding of pointer reads.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Tue, 11 Nov 2014 18:34:21 +0100 |
parents | 26351ce8c4b0 |
children |
rev | line source |
---|---|
6841
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
1 # |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
2 # Copyright (c) 2012, Red Hat, Inc. |
26351ce8c4b0
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. |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
4 # |
26351ce8c4b0
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 |
26351ce8c4b0
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 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
7 # published by the Free Software Foundation. |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
8 # |
26351ce8c4b0
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 |
26351ce8c4b0
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 |
26351ce8c4b0
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 |
26351ce8c4b0
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 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
13 # accompanied this code). |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
14 # |
26351ce8c4b0
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 |
26351ce8c4b0
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, |
26351ce8c4b0
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. |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
18 # |
26351ce8c4b0
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 |
26351ce8c4b0
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 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
21 # questions. |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
22 # |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
23 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
24 # @test SDTProbesGNULinuxTest.sh |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
25 # @bug 7170638 |
26351ce8c4b0
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 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
27 # @run shell SDTProbesGNULinuxTest.sh |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
28 |
26351ce8c4b0
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. |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
30 OS=`uname -s` |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
31 case "$OS" in |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
32 Linux ) |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
33 ;; |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
34 *) |
26351ce8c4b0
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" |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
36 exit 0; |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
37 ;; |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
38 esac |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
39 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
40 # Where is our java (parent) directory? |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
41 if [ "${TESTJAVA}" = "" ]; then |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
42 PARENT=$(dirname $(readlink -f $(which java))) |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
43 TESTJAVA=`dirname ${PARENT}` |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
44 echo "TESTJAVA directory not set, using " ${TESTJAVA} |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
45 fi |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
46 |
26351ce8c4b0
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. |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
48 ${TESTJAVA}/bin/java -XX:+ExtendedDTraceProbes -version |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
49 if [ "$?" != "0" ]; then |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
50 echo "Not build using DTRACE_ENABLED. PASSED" |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
51 exit 0 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
52 fi |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
53 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
54 # Test all available libjvm.so variants |
26351ce8c4b0
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 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
56 echo "Testing ${libjvm}" |
26351ce8c4b0
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. |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
58 readelf -S ${libjvm} | grep '.note.stapsdt' |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
59 if [ "$?" != "0" ]; then |
26351ce8c4b0
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." |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
61 exit 1 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
62 fi |
26351ce8c4b0
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 |
26351ce8c4b0
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. |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
65 done |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
66 |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
67 echo "Passed." |
26351ce8c4b0
8000622: Forgot to hg add and check in test for JDK-7170638
coleenp
parents:
diff
changeset
|
68 exit 0 |