changeset 23383:7b9a9c419f58

BenchmarkCounters: use options to enable static and dynamic counters.
author Josef Eisl <josef.eisl@jku.at>
date Thu, 04 Feb 2016 11:26:13 +0100
parents 4bfb6ce22dd3
children 40a929274cca
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java	Thu Feb 04 16:58:45 2016 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java	Thu Feb 04 11:26:13 2016 +0100
@@ -46,6 +46,7 @@
 import com.oracle.graal.options.Option;
 import com.oracle.graal.options.OptionType;
 import com.oracle.graal.options.OptionValue;
+import com.oracle.graal.options.StableOptionValue;
 
 //JaCoCo Exclude
 
@@ -101,11 +102,13 @@
         public static final OptionValue<Boolean> DynamicCountersPrintGroupSeparator = new OptionValue<>(true);
         @Option(help = "Print in human readable format", type = OptionType.Debug)
         public static final OptionValue<Boolean> DynamicCountersHumanReadable = new OptionValue<>(true);
+        @Option(help = "Dump dynamic counters", type = OptionType.Debug)
+        public static final StableOptionValue<Boolean> BenchmarkCountersDumpDynamic = new StableOptionValue<>(true);
+        @Option(help = "Dump static counters", type = OptionType.Debug)
+        public static final StableOptionValue<Boolean> BenchmarkCountersDumpStatic = new StableOptionValue<>(false);
         //@formatter:on
     }
 
-    private static final boolean DUMP_STATIC = false;
-
     public static boolean enabled = false;
 
     private static class Counter {
@@ -165,10 +168,12 @@
             counterMap.forEach((nameGroup, counter) -> set.add(counter.group));
             for (String group : set) {
                 if (group != null) {
-                    if (DUMP_STATIC) {
+                    if (Options.BenchmarkCountersDumpStatic.getValue()) {
                         dumpCounters(out, seconds, counters, true, group, maxRows);
                     }
-                    dumpCounters(out, seconds, counters, false, group, maxRows);
+                    if (Options.BenchmarkCountersDumpDynamic.getValue()) {
+                        dumpCounters(out, seconds, counters, false, group, maxRows);
+                    }
                 }
             }
             out.println("============================");