author | chegar |
Thu, 17 Oct 2019 20:54:25 +0100 | |
branch | datagramsocketimpl-branch |
changeset 58679 | 9c3209ff7550 |
parent 58678 | 9cf78a70fa4f |
parent 57705 | 7cf02b2c1455 |
permissions | -rw-r--r-- |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
1 |
/* |
57567
b000362a89a0
8202339: [TESTBUG] Consolidate the tests in runtime/SharedArchiveFile and runtime/appcds
coleenp
parents:
50634
diff
changeset
|
2 |
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
4 |
* |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
8 |
* |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
13 |
* accompanied this code). |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
14 |
* |
41705
332239c052cc
8165687: Fix license and copyright headers in jd9 under hotspot/test
stsmirno
parents:
40631
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
18 |
* |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
21 |
* questions. |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
22 |
*/ |
41705
332239c052cc
8165687: Fix license and copyright headers in jd9 under hotspot/test
stsmirno
parents:
40631
diff
changeset
|
23 |
|
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
24 |
/* |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
25 |
* @test |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
26 |
* @bug 8059510 |
46747
7b6570052b58
8130072: Add a flag to print out statistics for both system dictionary and shared dictionary
coleenp
parents:
46742
diff
changeset
|
27 |
* @summary Test jcmd VM.symboltable, VM.stringtable and VM.systemdictionary options |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
38089
diff
changeset
|
28 |
* @library /test/lib |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
29 |
* @run main/othervm -XX:+UnlockDiagnosticVMOptions DumpSymbolAndStringTable |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
30 |
*/ |
46491
e43953993af3
8180631: [TESTBUG] CDS tests should use CDSTestUtils.executeAndLog whenever spawning sub processes
mseledtsov
parents:
41705
diff
changeset
|
31 |
import jdk.test.lib.cds.CDSTestUtils; |
40631
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
38089
diff
changeset
|
32 |
import jdk.test.lib.process.ProcessTools; |
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
38089
diff
changeset
|
33 |
import jdk.test.lib.process.OutputAnalyzer; |
ed82623d7831
8157957: ClassNotFoundException: jdk.test.lib.JDKToolFinder
ctornqvi
parents:
38089
diff
changeset
|
34 |
import jdk.test.lib.JDKToolFinder; |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
35 |
|
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
36 |
public class DumpSymbolAndStringTable { |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
37 |
public static void main(String[] args) throws Exception { |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
38 |
// Grab my own PID |
38089
9e58203ef0e2
8153992: Some hotspot tests fail on compact2 due to an unnecessary test library dependency
akulyakh
parents:
36851
diff
changeset
|
39 |
String pid = Long.toString(ProcessTools.getProcessId()); |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
40 |
|
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
41 |
ProcessBuilder pb = new ProcessBuilder(); |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
42 |
pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.symboltable", "-verbose"}); |
46491
e43953993af3
8180631: [TESTBUG] CDS tests should use CDSTestUtils.executeAndLog whenever spawning sub processes
mseledtsov
parents:
41705
diff
changeset
|
43 |
OutputAnalyzer output = CDSTestUtils.executeAndLog(pb, "jcmd-symboltable"); |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
44 |
try { |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
45 |
output.shouldContain("24 2: DumpSymbolAndStringTable\n"); |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
46 |
} catch (RuntimeException e) { |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
47 |
output.shouldContain("Unknown diagnostic command"); |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
48 |
} |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
49 |
|
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
50 |
pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.stringtable", "-verbose"}); |
46491
e43953993af3
8180631: [TESTBUG] CDS tests should use CDSTestUtils.executeAndLog whenever spawning sub processes
mseledtsov
parents:
41705
diff
changeset
|
51 |
output = CDSTestUtils.executeAndLog(pb, "jcmd-stringtable"); |
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
52 |
try { |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
53 |
output.shouldContain("16: java.lang.String\n"); |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
54 |
} catch (RuntimeException e) { |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
55 |
output.shouldContain("Unknown diagnostic command"); |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
56 |
} |
46742 | 57 |
|
58 |
pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.systemdictionary"}); |
|
59 |
output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary"); |
|
60 |
try { |
|
50634
c349d409262a
8202605: Standardize on ClassLoaderData::loader_name() throughout the VM to obtain a class loader's name
lfoltan
parents:
49348
diff
changeset
|
61 |
output.shouldContain("System Dictionary for 'app' class loader statistics:"); |
46742 | 62 |
output.shouldContain("Number of buckets"); |
63 |
output.shouldContain("Number of entries"); |
|
64 |
output.shouldContain("Maximum bucket size"); |
|
65 |
} catch (RuntimeException e) { |
|
66 |
output.shouldContain("Unknown diagnostic command"); |
|
67 |
} |
|
68 |
||
69 |
pb.command(new String[] {JDKToolFinder.getJDKTool("jcmd"), pid, "VM.systemdictionary", "-verbose"}); |
|
70 |
output = CDSTestUtils.executeAndLog(pb, "jcmd-systemdictionary"); |
|
71 |
try { |
|
49348
fde3feaaa4ed
8198926: Move ClassLoaderData::_dependencies to ClassLoaderData::_handles
coleenp
parents:
47216
diff
changeset
|
72 |
output.shouldContain("Dictionary for loader data: 0x"); |
46742 | 73 |
output.shouldContain("^java.lang.String"); |
74 |
} catch (RuntimeException e) { |
|
75 |
output.shouldContain("Unknown diagnostic command"); |
|
76 |
} |
|
28363
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
77 |
} |
047115468f16
8059510: Compact symbol table layout inside shared archive.
jiangli
parents:
diff
changeset
|
78 |
} |