--- old/test/hotspot/jtreg/runtime/appcds/HelloExtTest.java 2018-08-22 09:26:34.851697817 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/HelloExtTest.java 2018-08-22 09:26:34.466661444 -0700 @@ -52,7 +52,7 @@ TestCommon.dump(appJar, TestCommon.list("javax/annotation/processing/FilerException", "[Ljava/lang/Comparable;"), - bootClassPath, "-verbose:class"); + bootClassPath); String prefix = ".class.load. "; String class_pattern = ".*LambdaForm[$]MH[/][0123456789].*"; @@ -60,12 +60,12 @@ String pattern = prefix + class_pattern + suffix; TestCommon.run("-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "-cp", appJar, bootClassPath, "-verbose:class", "HelloExt") + "-cp", appJar, bootClassPath, "-Xlog:class+load", "HelloExt") .assertNormalExit(output -> output.shouldNotMatch(pattern)); TestCommon.run("-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "-cp", appJar, bootClassPath, "-verbose:class", + "-cp", appJar, bootClassPath, "-Xlog:class+load", "-XX:+PrintSharedArchiveAndExit", "-XX:+PrintSharedDictionary", "HelloExt") .assertNormalExit(output -> output.shouldNotMatch(class_pattern)); --- old/test/hotspot/jtreg/runtime/appcds/OldClassTest.java 2018-08-22 09:26:35.639772262 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/OldClassTest.java 2018-08-22 09:26:35.263736740 -0700 @@ -67,7 +67,6 @@ TestCommon.run( "-cp", jar, - "-verbose:class", "Hello") .assertNormalExit("Hello Unicode world (Old)"); @@ -79,7 +78,6 @@ TestCommon.run( "-cp", classpath, - "-verbose:class", "Hello") .assertNormalExit("Hello Unicode world (Old)"); } --- old/test/hotspot/jtreg/runtime/appcds/ProhibitedPackage.java 2018-08-22 09:26:36.404844535 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/ProhibitedPackage.java 2018-08-22 09:26:36.054811469 -0700 @@ -79,20 +79,20 @@ // -Xshare:on TestCommon.run( "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "-cp", appJar, "-Xlog:class+load=info", "ProhibitedHelper") + "-cp", appJar, "ProhibitedHelper") .assertNormalExit("Prohibited package name: java.lang"); // -Xshare:auto output = TestCommon.execAuto( "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "-cp", appJar, "-Xlog:class+load=info", "ProhibitedHelper"); + "-cp", appJar, "ProhibitedHelper"); CDSOptions opts = (new CDSOptions()).setXShareMode("auto"); TestCommon.checkExec(output, opts, "Prohibited package name: java.lang"); // -Xshare:off output = TestCommon.execOff( "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "-cp", appJar, "-Xlog:class+load=info", "ProhibitedHelper"); + "-cp", appJar, "ProhibitedHelper"); output.shouldContain("Prohibited package name: java.lang"); } } --- old/test/hotspot/jtreg/runtime/appcds/ProtectionDomain.java 2018-08-22 09:26:37.206920304 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/ProtectionDomain.java 2018-08-22 09:26:36.823884120 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,16 +57,16 @@ OutputAnalyzer output; // First class is loaded from CDS, second class is loaded from JAR - output = TestCommon.exec(appJar, "-verbose:class", "ProtDomain"); + output = TestCommon.exec(appJar, "ProtDomain"); TestCommon.checkExec(output, "Protection Domains match"); // First class is loaded from JAR, second class is loaded from CDS - output = TestCommon.exec(appJar, "-verbose:class", "ProtDomainB"); + output = TestCommon.exec(appJar, "ProtDomainB"); TestCommon.checkExec(output, "Protection Domains match"); // Test ProtectionDomain for application and extension module classes from the // "modules" jimage - output = TestCommon.exec(appJar, "-verbose:class", "JimageClassProtDomain"); + output = TestCommon.exec(appJar, "JimageClassProtDomain"); output.shouldNotContain("Failed: Protection Domains do not match"); } } --- old/test/hotspot/jtreg/runtime/appcds/cacheObject/RedefineClassTest.java 2018-08-22 09:26:37.990994372 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/cacheObject/RedefineClassTest.java 2018-08-22 09:26:37.615958944 -0700 @@ -34,7 +34,7 @@ * RedefineClassApp * InstrumentationClassFileTransformer * InstrumentationRegisterClassFileTransformer - * @run main/othervm RedefineClassTest + * @run main RedefineClassTest */ import com.sun.tools.attach.VirtualMachine; @@ -89,7 +89,7 @@ bootCP, "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", - "-Xlog:gc+region=trace,cds=info", + "-Xlog:cds=info", agentCmdArg, "RedefineClassApp", bootJar, appJar); out.reportDiagnosticSummary(); --- old/test/hotspot/jtreg/runtime/appcds/javaldr/ArrayTest.java 2018-08-22 09:26:38.750066078 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/javaldr/ArrayTest.java 2018-08-22 09:26:38.392032256 -0700 @@ -57,7 +57,7 @@ String bootClassPath = "-Xbootclasspath/a:" + whiteBoxJar; // create an archive containing array classes - OutputAnalyzer output = TestCommon.dump(appJar, TestCommon.list(arrayClasses), bootClassPath, "-verbose:class"); + OutputAnalyzer output = TestCommon.dump(appJar, TestCommon.list(arrayClasses), bootClassPath); // we currently don't support array classes during CDS dump output.shouldContain("Preload Warning: Cannot find [Ljava/lang/Comparable;") .shouldContain("Preload Warning: Cannot find [I") @@ -70,7 +70,6 @@ argsList.add("-cp"); argsList.add(appJar); argsList.add(bootClassPath); - argsList.add("-verbose:class"); argsList.add("ArrayTestHelper"); // the following are input args to the ArrayTestHelper. // skip checking array classes during run time --- old/test/hotspot/jtreg/runtime/appcds/javaldr/GCDuringDump.java 2018-08-22 09:26:39.489135894 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/javaldr/GCDuringDump.java 2018-08-22 09:26:39.158104623 -0700 @@ -56,8 +56,6 @@ String appJar = ClassFileInstaller.writeJar("GCDuringDumpApp.jar", appClasses); - String gcLog = "-Xlog:gc*=info,gc+region=trace,gc+alloc+region=debug"; - for (int i=0; i<2; i++) { // i = 0 -- run without agent = no extra GCs // i = 1 -- run with agent = cause extra GCs @@ -65,13 +63,12 @@ String extraArg = (i == 0) ? "-showversion" : "-javaagent:" + agentJar; TestCommon.testDump(appJar, TestCommon.list("Hello"), - extraArg, "-Xmx32m", gcLog); + extraArg, "-Xmx32m"); TestCommon.run( "-cp", appJar, "-Xmx32m", "-XX:+PrintSharedSpaces", - gcLog, "Hello") .assertNormalExit(); } --- old/test/hotspot/jtreg/runtime/appcds/javaldr/GCDuringDumpTransformer.java 2018-08-22 09:26:40.194202499 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/javaldr/GCDuringDumpTransformer.java 2018-08-22 09:26:39.863171228 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,13 +28,8 @@ import java.security.ProtectionDomain; public class GCDuringDumpTransformer implements ClassFileTransformer { - static int n = 0; public byte[] transform(ClassLoader loader, String name, Class classBeingRedefined, ProtectionDomain pd, byte[] buffer) throws IllegalClassFormatException { - n++; - - System.out.println("dump time loading: " + name + " in loader: " + loader); - System.out.println("making garbage: " + n); try { makeGarbage(); } catch (Throwable t) { @@ -43,7 +38,6 @@ Thread.sleep(200); // let GC to have a chance to run } catch (Throwable t2) {} } - System.out.println("making garbage: done"); return null; } --- old/test/hotspot/jtreg/runtime/appcds/javaldr/GCSharedStringsDuringDump.java 2018-08-22 09:26:40.930272032 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/javaldr/GCSharedStringsDuringDump.java 2018-08-22 09:26:40.589239816 -0700 @@ -62,8 +62,6 @@ String appJar = ClassFileInstaller.writeJar("GCSharedStringsDuringDumpApp.jar", appClasses); - String gcLog = "-Xlog:gc*=info,gc+region=trace,gc+alloc+region=debug"; - String sharedArchiveCfgFile = System.getProperty("user.dir") + File.separator + "GCSharedStringDuringDump_gen.txt"; try (FileOutputStream fos = new FileOutputStream(sharedArchiveCfgFile)) { @@ -90,7 +88,7 @@ OutputAnalyzer output = TestCommon.dump( appJar, TestCommon.list("GCSharedStringsDuringDumpWb"), - bootClassPath, extraArg, "-Xmx32m", gcLog, + bootClassPath, extraArg, "-Xmx32m", "-XX:SharedArchiveConfigFile=" + sharedArchiveCfgFile); if (output.getStdout().contains("Too many string space regions") || @@ -102,7 +100,7 @@ // G1 heap region size to 2M TestCommon.testDump( appJar, TestCommon.list("GCSharedStringsDuringDumpWb"), - bootClassPath, extraArg, "-Xmx8g", "-XX:NewSize=8m", gcLog, + bootClassPath, extraArg, "-Xmx8g", "-XX:NewSize=8m", "-XX:SharedArchiveConfigFile=" + sharedArchiveCfgFile); } @@ -114,7 +112,6 @@ "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-XX:SharedReadOnlySize=30m", - gcLog, "GCSharedStringsDuringDumpWb") .assertNormalExit(); } --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddOpens.java 2018-08-22 09:26:41.708345533 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/AddOpens.java 2018-08-22 09:26:41.340310766 -0700 @@ -87,7 +87,6 @@ // the class in the modular jar in the -cp won't be archived. OutputAnalyzer output = TestCommon.createArchive( destJar.toString(), appClasses, - "-Xlog:class+load=trace", "--module-path", moduleDir.toString(), "-m", TEST_MODULE1); TestCommon.checkDump(output); --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/ExportModule.java 2018-08-22 09:26:42.487419128 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/ExportModule.java 2018-08-22 09:26:42.123384740 -0700 @@ -118,7 +118,6 @@ // the module in the --module-path OutputAnalyzer output = TestCommon.createArchive( appJar.toString(), appClasses, - "-Xlog:class+load=trace", "--module-path", moduleDir.toString(), "--add-modules", TEST_MODULE2, MAIN_CLASS); TestCommon.checkDump(output); @@ -142,7 +141,6 @@ // unnmaed. output = TestCommon.createArchive( appJar2.toString(), appClasses2, - "-Xlog:class+load=trace", "--module-path", moduleDir.toString(), "--add-modules", TEST_MODULE2, "--add-exports", "org.astro/org.astro=ALL-UNNAMED", --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/JvmtiAddPath.java 2018-08-22 09:26:43.286494613 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/JvmtiAddPath.java 2018-08-22 09:26:42.900458146 -0700 @@ -113,7 +113,6 @@ appJar, TestCommon.list("JvmtiApp", "ExtraClass", MAIN_CLASS), use_whitebox_jar, - "-Xlog:class+load=trace", modulePath); TestCommon.checkDump(output); @@ -143,7 +142,6 @@ output = TestCommon.createArchive( appJar, TestCommon.list("JvmtiApp", "ExtraClass"), use_whitebox_jar, - "-Xlog:class+load=trace", modulePath); TestCommon.checkDump(output); run(twoAppJars, modulePath, --- old/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/MainModuleOnly.java 2018-08-22 09:26:44.045566320 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jigsaw/modulepath/MainModuleOnly.java 2018-08-22 09:26:43.695533253 -0700 @@ -90,7 +90,6 @@ // the class in the modular jar in the -cp won't be archived. OutputAnalyzer output = TestCommon.createArchive( destJar.toString(), appClasses, - "-Xlog:class+load=trace", "--module-path", moduleDir.toString(), "-m", TEST_MODULE1); TestCommon.checkDump(output); @@ -169,8 +168,7 @@ // run with the archive and the jar with modified timestamp. // It should fail due to timestamp of the jar doesn't match the one // used during dump time. - TestCommon.run("-Xlog:class+load=trace", - "-cp", destJar.toString(), + TestCommon.run("-cp", destJar.toString(), "--module-path", moduleDir.toString(), "-m", TEST_MODULE1) .assertAbnormalExit( --- old/test/hotspot/jtreg/runtime/appcds/jvmti/transformRelatedClasses/TransformRelatedClassesAppCDS.java 2018-08-22 09:26:44.786636325 -0700 +++ new/test/hotspot/jtreg/runtime/appcds/jvmti/transformRelatedClasses/TransformRelatedClassesAppCDS.java 2018-08-22 09:26:44.442603826 -0700 @@ -188,7 +188,6 @@ TestCommon.run("-Xlog:class+load=info", "-cp", appJar, - "--add-opens=java.base/java.security=ALL-UNNAMED", agentParam, "CustomLoaderApp", customJar, loaderType, child) --- old/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2018-08-22 09:26:45.547708220 -0700 +++ new/test/lib/jdk/test/lib/cds/CDSTestUtils.java 2018-08-22 09:26:45.190674493 -0700 @@ -195,11 +195,19 @@ } } - // Specify this property to copy sdandard output of the child test process to - // the parent/main stdout of the test. - // By default such output is logged into a file, and is copied into the main stdout. - public static final boolean CopyChildStdoutToMainStdout = - Boolean.valueOf(System.getProperty("test.cds.copy.child.stdout", "true")); + // A number to be included in the filename of the stdout and the stderr output file. + static int count = 0; + + private static int getNextCount() { + return count++; + } + + // By default, stdout of child processes are logged in files such as + // -0000-exec.stdout. If you want to also include the stdout + // inside jtr files, you can override this in the jtreg command line like + // "jtreg -Dtest.cds.copy.child.stdout=true ...." + public static final boolean copyChildStdoutToMainStdout = + Boolean.getBoolean("test.cds.copy.child.stdout"); // This property is passed to child test processes public static final String TestTimeoutFactor = System.getProperty("test.timeout.factor", "1.0"); @@ -544,13 +552,17 @@ public static OutputAnalyzer executeAndLog(ProcessBuilder pb, String logName) throws Exception { long started = System.currentTimeMillis(); OutputAnalyzer output = new OutputAnalyzer(pb.start()); + String outputFileNamePrefix = + getTestName() + "-" + String.format("%04d", getNextCount()) + "-" + logName; - writeFile(getOutputFile(logName + ".stdout"), output.getStdout()); - writeFile(getOutputFile(logName + ".stderr"), output.getStderr()); + writeFile(getOutputFile(outputFileNamePrefix + ".stdout"), output.getStdout()); + writeFile(getOutputFile(outputFileNamePrefix + ".stderr"), output.getStderr()); System.out.println("[ELAPSED: " + (System.currentTimeMillis() - started) + " ms]"); + System.out.println("[logging stdout to " + outputFileNamePrefix + ".stdout]"); + System.out.println("[logging stderr to " + outputFileNamePrefix + ".stderr]"); System.out.println("[STDERR]\n" + output.getStderr()); - if (CopyChildStdoutToMainStdout) + if (copyChildStdoutToMainStdout) System.out.println("[STDOUT]\n" + output.getStdout()); return output;