# HG changeset patch # User Doug Simon # Date 1383845581 -3600 # Node ID 001b8429afc38c3a7cc24aa3154302607f5b2eaf # Parent 0e998f0daddf8596d7c3ea3ea819686df6933764 added ResetDebugValuesAfterBootstrap to separate out metrics gathered during bootstrap diff -r 0e998f0daddf -r 001b8429afc3 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Thu Nov 07 11:17:23 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Thu Nov 07 18:33:01 2013 +0100 @@ -54,6 +54,8 @@ public static final OptionValue DebugValueSummary = new OptionValue<>("Name"); @Option(help = "Omit reporting 0-value metrics") public static final OptionValue SuppressZeroDebugValues = new OptionValue<>(false); + @Option(help = "Report and reset metrics after bootstrapping") + public static final OptionValue ResetDebugValuesAfterBootstrap = new OptionValue<>(true); @Option(help = "Send Graal IR to dump handlers on error") public static final OptionValue DumpOnError = new OptionValue<>(false); @Option(help = "Enable expensive assertions") diff -r 0e998f0daddf -r 001b8429afc3 graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java --- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java Thu Nov 07 11:17:23 2013 +0100 +++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/DebugValueMap.java Thu Nov 07 18:33:01 2013 +0100 @@ -55,6 +55,15 @@ } } + public void reset() { + Arrays.fill(values, 0L); + if (children != null) { + for (DebugValueMap child : children) { + child.reset(); + } + } + } + private void ensureSize(int index) { if (values == null) { values = new long[index + 1]; diff -r 0e998f0daddf -r 001b8429afc3 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Thu Nov 07 11:17:23 2013 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Thu Nov 07 18:33:01 2013 +0100 @@ -323,6 +323,9 @@ } } while ((System.currentTimeMillis() - startTime) <= TimedBootstrap.getValue()); + if (ResetDebugValuesAfterBootstrap.getValue()) { + printDebugValues("bootstrap", true); + } phaseTransition("bootstrap"); bootstrapRunning = false; @@ -368,6 +371,25 @@ CompilationTask.withinEnqueue.set(Boolean.FALSE); } + printDebugValues(ResetDebugValuesAfterBootstrap.getValue() ? "application" : null, false); + phaseTransition("final"); + + if (runtime.getConfig().ciTime) { + parsedBytecodesPerSecond.printAll("ParsedBytecodesPerSecond", System.out); + inlinedBytecodesPerSecond.printAll("InlinedBytecodesPerSecond", System.out); + } + + SnippetCounter.printGroups(TTY.out().out()); + BenchmarkCounters.shutdown(runtime.getCompilerToVM(), compilerStartTime); + } + + private void printDebugValues(String phase, boolean reset) throws GraalInternalError { + TTY.println(); + if (phase != null) { + TTY.println(""); + } else { + TTY.println(""); + } if (Debug.isEnabled() && areMetricsOrTimersEnabled()) { List topLevelMaps = DebugValueMap.getTopLevelMaps(); List debugValues = KeyRegistry.getDebugValues(); @@ -414,16 +436,17 @@ throw new GraalInternalError("Unknown summary type: %s", summary); } } + if (reset) { + for (DebugValueMap topLevelMap : topLevelMaps) { + topLevelMap.reset(); + } + } + if (phase != null) { + TTY.println(""); + } else { + TTY.println(""); + } } - phaseTransition("final"); - - if (runtime.getConfig().ciTime) { - parsedBytecodesPerSecond.printAll("ParsedBytecodesPerSecond", System.out); - inlinedBytecodesPerSecond.printAll("InlinedBytecodesPerSecond", System.out); - } - - SnippetCounter.printGroups(TTY.out().out()); - BenchmarkCounters.shutdown(runtime.getCompilerToVM(), compilerStartTime); } private void flattenChildren(DebugValueMap map, DebugValueMap globalMap) {