# HG changeset patch # User Tom Rodriguez # Date 1427309281 25200 # Node ID 33b1be0d91fccdf20f547b9f408ae34315c1de45 # Parent d3b3a094df52c99d6aee64d98f9771bd0d89f3c7 Add option to filter DebugValueSummary by map name diff -r d3b3a094df52 -r 33b1be0d91fc 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 Wed Mar 25 11:47:55 2015 -0700 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java Wed Mar 25 11:48:01 2015 -0700 @@ -66,6 +66,8 @@ public static final OptionValue DebugValueSummary = new OptionValue<>("Name"); @Option(help = "Omit reporting 0-value metrics", type = OptionType.Debug) public static final OptionValue SuppressZeroDebugValues = new OptionValue<>(true); + @Option(help = "Only report debug values for maps which match the regular expression.", type = OptionType.Debug) + public static final OptionValue DebugValueThreadFilter = new OptionValue<>(null); @Option(help = "Send Graal IR to dump handlers on error", type = OptionType.Debug) public static final OptionValue DumpOnError = new OptionValue<>(false); @Option(help = "Intercept also bailout exceptions", type = OptionType.Debug) diff -r d3b3a094df52 -r 33b1be0d91fc graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/DebugValuesPrinter.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/DebugValuesPrinter.java Wed Mar 25 11:47:55 2015 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/DebugValuesPrinter.java Wed Mar 25 11:48:01 2015 -0700 @@ -26,6 +26,8 @@ import java.io.*; import java.util.*; +import java.util.regex.*; +import java.util.stream.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.debug.*; @@ -51,6 +53,12 @@ if (summary == null) { summary = "Complete"; } + if (DebugValueThreadFilter.getValue() != null && topLevelMaps.size() != 0) { + topLevelMaps = topLevelMaps.stream().filter(map -> Pattern.compile(DebugValueThreadFilter.getValue()).matcher(map.getName()).find()).collect(Collectors.toList()); + if (topLevelMaps.size() == 0) { + TTY.println("Warning: DebugValueThreadFilter=%s eliminated all maps so nothing will be printed", DebugValueThreadFilter.getValue()); + } + } switch (summary) { case "Name": printSummary(topLevelMaps, sortedValues);