changeset 12506:1be3cb11f88e

enable zero-count metrics to be shown (disable with new -G:+SuppressZeroDebugValues option)
author Doug Simon <doug.simon@oracle.com>
date Mon, 21 Oct 2013 22:47:54 +0200
parents 0b0e60214f49
children d72864a2886e
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/MetricImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java
diffstat 3 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java	Mon Oct 21 18:37:19 2013 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalDebugConfig.java	Mon Oct 21 22:47:54 2013 +0200
@@ -52,6 +52,8 @@
                    "Complete - aggregate by qualified name%n" +
                    "Thread - aggregate by qualified name and thread")
     public static final OptionValue<String> DebugValueSummary = new OptionValue<>("Name");
+    @Option(help = "Omit reporting 0-value metrics")
+    public static final OptionValue<Boolean> SuppressZeroDebugValues = new OptionValue<>(false);
     @Option(help = "Send Graal IR to dump handlers on error")
     public static final OptionValue<Boolean> DumpOnError = new OptionValue<>(false);
     @Option(help = "Enable expensive assertions")
--- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/MetricImpl.java	Mon Oct 21 18:37:19 2013 +0200
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/internal/MetricImpl.java	Mon Oct 21 22:47:54 2013 +0200
@@ -28,6 +28,8 @@
 
     public MetricImpl(String name, boolean conditional) {
         super(name, conditional);
+        // Allows for zero-count metrics to be shown
+        getCurrentValue();
     }
 
     public void increment() {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Mon Oct 21 18:37:19 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Mon Oct 21 22:47:54 2013 +0200
@@ -533,7 +533,7 @@
 
         for (DebugValue value : debugValues) {
             long l = scope.map.getCurrentValue(value.getIndex());
-            if (l != 0) {
+            if (l != 0 || !SuppressZeroDebugValues.getValue()) {
                 scope.print();
                 printIndent(scope.level + 1);
                 TTY.println(value.getName() + "=" + value.toString(l));