# HG changeset patch # User dfazunen # Date 1466190249 0 # Node ID e0a56038a15e2f008d707c63c1fdd35f6a10ad69 # Parent 4be906c4ad953ff5d0021732b370273f4b52639b# Parent 25532d6696beefb2b53f89f631aed1edd7a5221e Merge diff -r 4be906c4ad95 -r e0a56038a15e hotspot/src/share/vm/runtime/thread.cpp --- a/hotspot/src/share/vm/runtime/thread.cpp Fri Jun 17 18:45:09 2016 +0300 +++ b/hotspot/src/share/vm/runtime/thread.cpp Fri Jun 17 19:04:09 2016 +0000 @@ -3405,6 +3405,8 @@ // // After phase 2, The VM will begin search classes from -Xbootclasspath/a. static void call_initPhase2(TRAPS) { + TraceTime timer("Phase2 initialization", TRACETIME_LOG(Info, modules, startuptime)); + Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK); instanceKlassHandle klass (THREAD, k); diff -r 4be906c4ad95 -r e0a56038a15e hotspot/test/runtime/logging/StartupTimeTest.java --- a/hotspot/test/runtime/logging/StartupTimeTest.java Fri Jun 17 18:45:09 2016 +0300 +++ b/hotspot/test/runtime/logging/StartupTimeTest.java Fri Jun 17 19:04:09 2016 +0000 @@ -50,6 +50,18 @@ output.shouldHaveExitValue(0); } + static void analyzeModulesOutputOn(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldMatch("(Phase2 initialization, [0-9]+.[0-9]+ secs)"); + output.shouldHaveExitValue(0); + } + + static void analyzeModulesOutputOff(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("[modules,startuptime]"); + output.shouldHaveExitValue(0); + } + public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:startuptime", InnerClass.class.getName()); @@ -58,6 +70,14 @@ pb = ProcessTools.createJavaProcessBuilder("-Xlog:startuptime=off", InnerClass.class.getName()); analyzeOutputOff(pb); + + pb = ProcessTools.createJavaProcessBuilder("-Xlog:startuptime+modules", + InnerClass.class.getName()); + analyzeModulesOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder("-Xlog:startuptime+modules=off", + InnerClass.class.getName()); + analyzeModulesOutputOff(pb); } public static class InnerClass {