4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 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 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import compiler.testlibrary.CompilerUtils;
25 import jdk.test.lib.Asserts;
26 import jdk.test.lib.JDKToolFinder;
27 import jdk.test.lib.OutputAnalyzer;
28 import jdk.test.lib.Utils;
29 import jdk.test.lib.dtrace.DtraceResultsAnalyzer;
30 import jdk.test.lib.dtrace.DtraceRunner;
31 import java.io.IOException;
32 import java.lang.reflect.Executable;
33 import java.nio.file.Files;
34 import java.nio.file.Paths;
35 import java.util.Arrays;
36 import java.util.Collections;
37 import java.util.HashMap;
38 import java.util.HashSet;
39 import java.util.List;
40 import java.util.Map;
41 import java.util.Random;
42 import java.util.Set;
43 import java.util.regex.Matcher;
44 import java.util.regex.Pattern;
45 import java.util.stream.Collectors;
46
47 /*
48 * @test SegmentedCodeCacheDtraceTest
49 * @bug 8015774
50 * @requires os.family=="solaris"
51 * @modules java.base/jdk.internal.misc
52 * @library /testlibrary / /test/lib
53 * @build SegmentedCodeCacheDtraceTestWorker
54 * @run main ClassFileInstaller sun.hotspot.WhiteBox
55 * sun.hotspot.WhiteBox$WhiteBoxPermission
56 * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+TieredCompilation
57 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
58 * SegmentedCodeCacheDtraceTest
59 * @summary testing of dtrace for segmented code cache
60 */
61 public class SegmentedCodeCacheDtraceTest {
62
63 private static final String WORKER_CLASS_NAME
64 = SegmentedCodeCacheDtraceTestWorker.class.getName();
65 private static final String JAVA_OPTS = " -XX:+DTraceMethodProbes "
66 + "-Xbootclasspath/a:" + System.getProperty("test.classes") + " "
67 + "-XX:+UnlockDiagnosticVMOptions "
68 + "-XX:+WhiteBoxAPI -XX:+SegmentedCodeCache "
69 + "-XX:CompileCommand=compileonly,"
70 + WORKER_CLASS_NAME + "::* "
71 + " -classpath " + System.getProperty("test.class.path") + " "
72 + String.join(" ", Utils.getTestJavaOpts());
73 private static final String DTRACE_SCRIPT
74 = "SegmentedCodeCacheDtraceTestScript.d";
75 private static final List<Executable> MLIST =
76 SegmentedCodeCacheDtraceTestWorker.TESTED_METHODS_LIST;
77 private static final int WORKER_METHODS_COUNT = MLIST.size();
78
79 private void runTest(TestCombination tc) {
80 String params = MLIST.stream()
|
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 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 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test SegmentedCodeCacheDtraceTest
26 * @bug 8015774
27 * @summary testing of dtrace for segmented code cache
28 * @requires os.family=="solaris"
29 * @modules java.base/jdk.internal.misc
30 * @library /testlibrary /test/lib /
31 *
32 * @build compiler.codecache.dtrace.SegmentedCodeCacheDtraceTest
33 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
34 * sun.hotspot.WhiteBox$WhiteBoxPermission
35 * @run main/othervm/timeout=600 -Xbootclasspath/a:.
36 * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
37 * compiler.codecache.dtrace.SegmentedCodeCacheDtraceTest
38 */
39
40 package compiler.codecache.dtrace;
41
42 import compiler.testlibrary.CompilerUtils;
43 import jdk.test.lib.Asserts;
44 import jdk.test.lib.JDKToolFinder;
45 import jdk.test.lib.OutputAnalyzer;
46 import jdk.test.lib.Utils;
47 import jdk.test.lib.dtrace.DtraceResultsAnalyzer;
48 import jdk.test.lib.dtrace.DtraceRunner;
49
50 import java.io.IOException;
51 import java.lang.reflect.Executable;
52 import java.nio.file.Files;
53 import java.nio.file.Paths;
54 import java.util.Arrays;
55 import java.util.Collections;
56 import java.util.HashMap;
57 import java.util.HashSet;
58 import java.util.List;
59 import java.util.Map;
60 import java.util.Random;
61 import java.util.Set;
62 import java.util.regex.Matcher;
63 import java.util.regex.Pattern;
64 import java.util.stream.Collectors;
65
66 public class SegmentedCodeCacheDtraceTest {
67
68 private static final String WORKER_CLASS_NAME
69 = SegmentedCodeCacheDtraceTestWorker.class.getName();
70 private static final String JAVA_OPTS = " -XX:+DTraceMethodProbes "
71 + "-Xbootclasspath/a:" + System.getProperty("test.classes") + " "
72 + "-XX:+UnlockDiagnosticVMOptions "
73 + "-XX:+WhiteBoxAPI -XX:+SegmentedCodeCache "
74 + "-XX:CompileCommand=compileonly,"
75 + WORKER_CLASS_NAME + "::* "
76 + " -classpath " + System.getProperty("test.class.path") + " "
77 + String.join(" ", Utils.getTestJavaOpts());
78 private static final String DTRACE_SCRIPT
79 = "SegmentedCodeCacheDtraceTestScript.d";
80 private static final List<Executable> MLIST =
81 SegmentedCodeCacheDtraceTestWorker.TESTED_METHODS_LIST;
82 private static final int WORKER_METHODS_COUNT = MLIST.size();
83
84 private void runTest(TestCombination tc) {
85 String params = MLIST.stream()
|