# HG changeset patch # User Josef Eisl # Date 1454581573 -3600 # Node ID 7b9a9c419f583c6ebf70576be46911f02f4ae350 # Parent 4bfb6ce22dd3c8b871956fd1f9730f6adcc17a4f BenchmarkCounters: use options to enable static and dynamic counters. diff -r 4bfb6ce22dd3 -r 7b9a9c419f58 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/debug/BenchmarkCounters.java --- 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 DynamicCountersPrintGroupSeparator = new OptionValue<>(true); @Option(help = "Print in human readable format", type = OptionType.Debug) public static final OptionValue DynamicCountersHumanReadable = new OptionValue<>(true); + @Option(help = "Dump dynamic counters", type = OptionType.Debug) + public static final StableOptionValue BenchmarkCountersDumpDynamic = new StableOptionValue<>(true); + @Option(help = "Dump static counters", type = OptionType.Debug) + public static final StableOptionValue 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("============================");