test/hotspot/jtreg/compiler/aot/fingerprint/CDSDumper.java
Index
Unified diffs
Context diffs
Sdiffs
Frames
Patch
New
Old
Previous File
Next File
open Cdiff test/hotspot/jtreg/compiler/aot/fingerprint/CDSDumper.java
test/hotspot/jtreg/compiler/aot/fingerprint/CDSDumper.java
Print this page
*** 29,67 ****
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
// Usage:
! // java CDSDumper <classpath> <classlist> <archive> <class1> <class2> ...
public class CDSDumper {
public static void main(String[] args) throws Exception {
String classpath = args[0];
String classlist = args[1];
String archive = args[2];
// Prepare the classlist
FileOutputStream fos = new FileOutputStream(classlist);
PrintStream ps = new PrintStream(fos);
! for (int i=3; i<args.length; i++) {
ps.println(args[i].replace('.', '/'));
}
ps.close();
fos.close();
// Dump the archive
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-XX:+IgnoreUnrecognizedVMOptions",
"-XX:+UnlockCommercialFeatures",
"-XX:+UseAppCDS",
"-XX:+UnlockDiagnosticVMOptions",
"-cp", classpath,
"-XX:ExtraSharedClassListFile=" + classlist,
"-XX:SharedArchiveFile=" + archive,
"-Xshare:dump",
"-Xlog:cds");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("Loading classes to share");
output.shouldHaveExitValue(0);
}
}
--- 29,72 ----
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
// Usage:
! // java CDSDumper <classpath> <classlist> <archive> <heapsize> <class1> <class2> ...
public class CDSDumper {
public static void main(String[] args) throws Exception {
String classpath = args[0];
String classlist = args[1];
String archive = args[2];
+ String heapsize = args[3];
// Prepare the classlist
FileOutputStream fos = new FileOutputStream(classlist);
PrintStream ps = new PrintStream(fos);
! for (int i=4; i<args.length; i++) {
ps.println(args[i].replace('.', '/'));
}
ps.close();
fos.close();
// Dump the archive
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+ heapsize,
"-XX:+IgnoreUnrecognizedVMOptions",
"-XX:+UnlockCommercialFeatures",
"-XX:+UseAppCDS",
"-XX:+UnlockDiagnosticVMOptions",
"-cp", classpath,
"-XX:ExtraSharedClassListFile=" + classlist,
"-XX:SharedArchiveFile=" + archive,
"-Xshare:dump",
+ "-Xlog:gc+heap+coops",
"-Xlog:cds");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
+ System.out.println("[stdout = " + output.getStdout() + "]");
+ System.out.println("[stderr = " + output.getStderr() + "]");
output.shouldContain("Loading classes to share");
output.shouldHaveExitValue(0);
}
}
test/hotspot/jtreg/compiler/aot/fingerprint/CDSDumper.java
Index
Unified diffs
Context diffs
Sdiffs
Frames
Patch
New
Old
Previous File
Next File