# HG changeset patch # User Doug Simon # Date 1376983887 -7200 # Node ID 03fb03763b6329d86e3000a74ade2015f6616aee # Parent c64d90e962edecd480b2a522c1df0d8324d78983 small fixes for handling of -G:DebugValueSummary option diff -r c64d90e962ed -r 03fb03763b63 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 Tue Aug 20 07:59:52 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Tue Aug 20 09:31:27 2013 +0200 @@ -50,9 +50,9 @@ public static final OptionValue MethodFilter = new OptionValue<>(null); @Option(help = "How to print metric and timing values:%n" + "Name - aggregate by unqualified name%n" + - "Thread - aggregate by qualified name and thread%n" + + "Partial - aggregate by partially qualified name (e.g., A.B.C.D.Counter and X.Y.Z.D.Counter will be merged to D.Counter)%n" + "Complete - aggregate by qualified name%n" + - "Partial - aggregate by partially qualified name (e.g., A.B.C.D.Counter and X.Y.Z.D.Counter will be merged to D.Counter)") + "Thread - aggregate by qualified name and thread") public static final OptionValue DebugValueSummary = new OptionValue<>("Complete"); @Option(help = "Send Graal IR to dump handlers on error") public static final OptionValue DumpOnError = new OptionValue<>(false); diff -r c64d90e962ed -r 03fb03763b63 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 Tue Aug 20 07:59:52 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Tue Aug 20 09:31:27 2013 +0200 @@ -174,6 +174,19 @@ if (DebugEnabled.getValue()) { DebugEnvironment.initialize(log); + + String summary = DebugValueSummary.getValue(); + if (summary != null) { + switch (summary) { + case "Name": + case "Partial": + case "Complete": + case "Thread": + break; + default: + throw new GraalInternalError("Unsupported value for DebugSummaryValue: %s", summary); + } + } } assert VerifyHotSpotOptionsPhase.checkOptions(); @@ -448,10 +461,13 @@ String summary = DebugValueSummary.getValue(); if (summary == null) { - summary = "Scope"; + summary = "Complete"; } switch (summary) { - case "PartialScope": { + case "Name": + printSummary(topLevelMaps, sortedValues); + break; + case "Partial": { DebugValueMap globalMap = new DebugValueMap("Global"); for (DebugValueMap map : topLevelMaps) { flattenChildren(map, globalMap); @@ -460,6 +476,16 @@ printMap(new DebugValueScope(null, globalMap), sortedValues); break; } + case "Complete": { + DebugValueMap globalMap = new DebugValueMap("Global"); + for (DebugValueMap map : topLevelMaps) { + globalMap.addChild(map); + } + globalMap.group(); + globalMap.normalize(); + printMap(new DebugValueScope(null, globalMap), sortedValues); + break; + } case "Thread": for (DebugValueMap map : topLevelMaps) { TTY.println("Showing the results for thread: " + map.getName()); @@ -468,20 +494,8 @@ printMap(new DebugValueScope(null, map), sortedValues); } break; - case "Name": - printSummary(topLevelMaps, sortedValues); - break; - case "Scope": // fall through - default: { - DebugValueMap globalMap = new DebugValueMap("Global"); - for (DebugValueMap map : topLevelMaps) { - globalMap.addChild(map); - } - globalMap.group(); - globalMap.normalize(); - printMap(new DebugValueScope(null, globalMap), sortedValues); - break; - } + default: + throw new GraalInternalError("Unknown summary type: %s", summary); } } }