changeset 333:fea0f45a817f

Remove OutputFormatType, merging the selection of output formats with verbosity levels.
author shade
date Fri, 10 Jan 2014 15:54:51 +0400
parents 2afa6cc3da01
children 3b689c865a9f
files jmh-api-samples/src/main/java/org/openjdk/jmh/SimpleTest.java jmh-core-benchmarks/src/main/java/org/openjdk/jmh/MainValidation.java jmh-core-it/src/test/java/org/openjdk/jmh/it/IterationCountAnnTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/ccontrol/CompilerControlDontInlineTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/ccontrol/CompilerControlExcludeTest.java jmh-core-it/src/test/java/org/openjdk/jmh/it/ccontrol/CompilerControlInlineTest.java jmh-core/src/main/java/org/openjdk/jmh/Main.java jmh-core/src/main/java/org/openjdk/jmh/output/OutputFormatFactory.java jmh-core/src/main/java/org/openjdk/jmh/output/format/AbstractOutputFormat.java jmh-core/src/main/java/org/openjdk/jmh/output/format/OutputFormat.java jmh-core/src/main/java/org/openjdk/jmh/output/format/OutputFormatFactory.java jmh-core/src/main/java/org/openjdk/jmh/output/format/SilentFormat.java jmh-core/src/main/java/org/openjdk/jmh/output/format/TextReportFormat.java jmh-core/src/main/java/org/openjdk/jmh/profile/ProfilerType.java jmh-core/src/main/java/org/openjdk/jmh/runner/BaseMicroBenchmarkHandler.java jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java jmh-core/src/main/java/org/openjdk/jmh/runner/ForkedRunner.java jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/ChainedOptionsBuilder.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/Options.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/OptionsBuilder.java jmh-core/src/main/java/org/openjdk/jmh/runner/options/VerboseMode.java jmh-core/src/test/java/org/openjdk/jmh/runner/TestMicroBenchmarkList.java jmh-core/src/test/java/org/openjdk/jmh/runner/options/TestOptions.java
diffstat 25 files changed, 217 insertions(+), 252 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-api-samples/src/main/java/org/openjdk/jmh/SimpleTest.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-api-samples/src/main/java/org/openjdk/jmh/SimpleTest.java	Fri Jan 10 15:54:51 2014 +0400
@@ -26,7 +26,6 @@
 
 import org.openjdk.jmh.logic.results.Result;
 import org.openjdk.jmh.logic.results.RunResult;
-import org.openjdk.jmh.output.OutputFormatType;
 import org.openjdk.jmh.runner.Runner;
 import org.openjdk.jmh.runner.RunnerException;
 import org.openjdk.jmh.runner.options.Options;
@@ -46,7 +45,6 @@
                 .measurementTime(TimeValue.milliseconds(100))
                 .jvmArgs("-server")
                 .forks(5)
-                .outputFormat(OutputFormatType.TextReport)
                 .build();
 
         RunResult runResult = new Runner(opts).runSingle();
--- a/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/MainValidation.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core-benchmarks/src/main/java/org/openjdk/jmh/MainValidation.java	Fri Jan 10 15:54:51 2014 +0400
@@ -31,11 +31,11 @@
 import org.openjdk.jmh.benchmarks.NanoTimerBench;
 import org.openjdk.jmh.logic.results.Result;
 import org.openjdk.jmh.logic.results.RunResult;
-import org.openjdk.jmh.output.OutputFormatType;
 import org.openjdk.jmh.runner.Runner;
 import org.openjdk.jmh.runner.RunnerException;
 import org.openjdk.jmh.runner.options.Options;
 import org.openjdk.jmh.runner.options.OptionsBuilder;
+import org.openjdk.jmh.runner.options.VerboseMode;
 
 import java.io.PrintWriter;
 
@@ -62,7 +62,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(EmptyBench.class.getCanonicalName() + ".*")
-                    .outputFormat(OutputFormatType.Silent)
+                    .verbosity(VerboseMode.Silent)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -76,7 +76,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelTrialBench.class.getCanonicalName() + ".*benchmark_setup")
-                    .outputFormat(OutputFormatType.Silent)
+                    .verbosity(VerboseMode.Silent)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -90,7 +90,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelTrialBench.class.getCanonicalName() + ".*benchmark_teardown")
-                    .outputFormat(OutputFormatType.Silent)
+                    .verbosity(VerboseMode.Silent)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -104,7 +104,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelIterationBench.class.getCanonicalName() + ".*benchmark_setup")
-                    .outputFormat(OutputFormatType.Silent)
+                    .verbosity(VerboseMode.Silent)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -118,7 +118,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelIterationBench.class.getCanonicalName() + ".*benchmark_teardown")
-                    .outputFormat(OutputFormatType.Silent)
+                    .verbosity(VerboseMode.Silent)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -132,7 +132,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelInvocationBench.class.getCanonicalName() + ".*benchmark_setup")
-                    .outputFormat(OutputFormatType.Silent)
+                    .verbosity(VerboseMode.Silent)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -146,7 +146,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(LevelInvocationBench.class.getCanonicalName() + ".*benchmark_teardown")
-                    .outputFormat(OutputFormatType.Silent)
+                    .verbosity(VerboseMode.Silent)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -172,7 +172,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(NanoTimerBench.class.getCanonicalName() + ".*latency")
-                    .outputFormat(OutputFormatType.Silent)
+                    .verbosity(VerboseMode.Silent)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
@@ -189,7 +189,7 @@
         {
             Options opts = new OptionsBuilder()
                     .include(NanoTimerBench.class.getCanonicalName() + ".*granularity")
-                    .outputFormat(OutputFormatType.Silent)
+                    .verbosity(VerboseMode.Silent)
                     .build();
 
             RunResult result = new Runner(opts).runSingle();
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/IterationCountAnnTest.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/IterationCountAnnTest.java	Fri Jan 10 15:54:51 2014 +0400
@@ -41,6 +41,7 @@
 import org.openjdk.jmh.runner.RunnerException;
 import org.openjdk.jmh.runner.options.Options;
 import org.openjdk.jmh.runner.options.OptionsBuilder;
+import org.openjdk.jmh.runner.options.VerboseMode;
 
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -79,7 +80,6 @@
         Options opts = new OptionsBuilder()
                 .include(Fixtures.getTestMask(this.getClass()))
                 .shouldFailOnError(true)
-                .verbose(true)
                 .build();
         new Runner(opts).run();
     }
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/ccontrol/CompilerControlDontInlineTest.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/ccontrol/CompilerControlDontInlineTest.java	Fri Jan 10 15:54:51 2014 +0400
@@ -57,7 +57,6 @@
         Options opt = new OptionsBuilder()
                 .include(Fixtures.getTestMask(this.getClass()))
                 .shouldFailOnError(true)
-                .verbose(true)
                 .build();
         new Runner(opt).run();
     }
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/ccontrol/CompilerControlExcludeTest.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/ccontrol/CompilerControlExcludeTest.java	Fri Jan 10 15:54:51 2014 +0400
@@ -57,7 +57,6 @@
         Options opt = new OptionsBuilder()
                 .include(Fixtures.getTestMask(this.getClass()))
                 .shouldFailOnError(true)
-                .verbose(true)
                 .build();
         new Runner(opt).run();
     }
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/ccontrol/CompilerControlInlineTest.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/ccontrol/CompilerControlInlineTest.java	Fri Jan 10 15:54:51 2014 +0400
@@ -57,7 +57,6 @@
         Options opt = new OptionsBuilder()
                 .include(Fixtures.getTestMask(this.getClass()))
                 .shouldFailOnError(true)
-                .verbose(true)
                 .build();
         new Runner(opt).run();
     }
--- a/jmh-core/src/main/java/org/openjdk/jmh/Main.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/Main.java	Fri Jan 10 15:54:51 2014 +0400
@@ -25,7 +25,6 @@
 package org.openjdk.jmh;
 
 import org.kohsuke.args4j.CmdLineException;
-import org.openjdk.jmh.output.OutputFormatType;
 import org.openjdk.jmh.output.results.ResultFormatType;
 import org.openjdk.jmh.profile.ProfilerFactory;
 import org.openjdk.jmh.runner.Runner;
@@ -50,20 +49,6 @@
         try {
             cmdOptions.parseArguments(argv);
 
-            // list output formats?
-            if (cmdOptions.shouldListOutputFormats()) {
-                StringBuilder sb = new StringBuilder();
-
-                for (OutputFormatType f : OutputFormatType.values()) {
-                    sb.append(f.toString().toLowerCase());
-                    sb.append(", ");
-                }
-                sb.setLength(sb.length() - 2);
-
-                System.out.println("Available formats: " + sb.toString());
-                return;
-            }
-
             if (cmdOptions.shouldListResultFormats()) {
                 StringBuilder sb = new StringBuilder();
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/OutputFormatFactory.java	Thu Jan 09 20:14:51 2014 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package org.openjdk.jmh.output;
-
-import org.openjdk.jmh.link.BinaryLinkClient;
-import org.openjdk.jmh.output.format.OutputFormat;
-import org.openjdk.jmh.output.format.SilentFormat;
-import org.openjdk.jmh.output.format.TextReportFormat;
-
-import java.io.PrintStream;
-import java.lang.reflect.Proxy;
-
-public class OutputFormatFactory {
-
-    /**
-     * Factory method for OutputFormat instances
-     *
-     * @param format Format enum to use
-     * @return a new OutputFormat instance of given type
-     */
-    public static OutputFormat createFormatInstance(PrintStream out, OutputFormatType format, boolean verbose) {
-        assert (format != null) : "format is not null";
-
-        switch (format) {
-            case Silent:
-                return new SilentFormat(out, verbose);
-            case TextReport:
-                return new TextReportFormat(out, verbose);
-            default:
-                throw new IllegalArgumentException("Format: " + format + " not found!");
-        }
-    }
-
-    /**
-     * Factory method - returns output format for forked JVM.
-     * @return
-     */
-    public static OutputFormat createBinaryHook(BinaryLinkClient link) {
-        return (OutputFormat) Proxy.newProxyInstance(
-                Thread.currentThread().getContextClassLoader(),
-                new Class[]{OutputFormat.class},
-                link.getOutputFormatHandler()
-        );
-    }
-
-    public static OutputFormat createFormatInstance(boolean verbose) {
-        return createFormatInstance(System.out, OutputFormatType.TextReport, verbose);
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/format/AbstractOutputFormat.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/format/AbstractOutputFormat.java	Fri Jan 10 15:54:51 2014 +0400
@@ -24,6 +24,8 @@
  */
 package org.openjdk.jmh.output.format;
 
+import org.openjdk.jmh.runner.options.VerboseMode;
+
 import java.io.IOException;
 import java.io.PrintStream;
 import java.util.logging.Level;
@@ -32,15 +34,11 @@
 public abstract class AbstractOutputFormat implements OutputFormat {
 
     /** Verbose-mode? */
-    final boolean verbose;
+    final VerboseMode verbose;
     /** PrintStream to use */
     final PrintStream out;
 
-    public AbstractOutputFormat(PrintStream out) {
-        this(out, false);
-    }
-
-    public AbstractOutputFormat(PrintStream out, boolean verbose) {
+    public AbstractOutputFormat(PrintStream out, VerboseMode verbose) {
         this.out = out;
         this.verbose = verbose;
     }
@@ -57,7 +55,7 @@
 
     @Override
     public void verbosePrintln(String s) {
-        if (verbose) {
+        if (verbose == VerboseMode.Extra) {
             out.println(s);
         }
     }
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/format/OutputFormat.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/format/OutputFormat.java	Fri Jan 10 15:54:51 2014 +0400
@@ -65,10 +65,8 @@
 
     /**
      * Format for start-of-benchmark output.
-     *
-     * @param verbose Should we output verbose info?
      */
-    public void startBenchmark(BenchmarkRecord name, BenchmarkParams mbParams, boolean verbose);
+    public void startBenchmark(BenchmarkRecord name, BenchmarkParams mbParams);
 
     /**
      * Format for end-of-benchmark.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/format/OutputFormatFactory.java	Fri Jan 10 15:54:51 2014 +0400
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.output.format;
+
+import org.openjdk.jmh.link.BinaryLinkClient;
+import org.openjdk.jmh.output.format.OutputFormat;
+import org.openjdk.jmh.output.format.SilentFormat;
+import org.openjdk.jmh.output.format.TextReportFormat;
+import org.openjdk.jmh.runner.options.VerboseMode;
+
+import java.io.PrintStream;
+import java.lang.reflect.Proxy;
+
+public class OutputFormatFactory {
+
+    /**
+     * Factory method for OutputFormat instances
+     *
+     * @param mode LogMode enum to use
+     * @return a new OutputFormat instance of given type
+     */
+    public static OutputFormat createFormatInstance(PrintStream out, VerboseMode mode) {
+        switch (mode) {
+            case Silent:
+                return new SilentFormat(out, mode);
+            case Normal:
+            case Extra:
+                return new TextReportFormat(out, mode);
+            default:
+                throw new IllegalArgumentException("Mode " + mode + " not found!");
+        }
+    }
+
+    /**
+     * Factory method - returns output format for forked JVM.
+     * @return
+     */
+    public static OutputFormat createBinaryHook(BinaryLinkClient link) {
+        return (OutputFormat) Proxy.newProxyInstance(
+                Thread.currentThread().getContextClassLoader(),
+                new Class[]{OutputFormat.class},
+                link.getOutputFormatHandler()
+        );
+    }
+
+}
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/format/SilentFormat.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/format/SilentFormat.java	Fri Jan 10 15:54:51 2014 +0400
@@ -28,6 +28,7 @@
 import org.openjdk.jmh.logic.results.IterationResult;
 import org.openjdk.jmh.logic.results.RunResult;
 import org.openjdk.jmh.runner.BenchmarkRecord;
+import org.openjdk.jmh.runner.options.VerboseMode;
 import org.openjdk.jmh.runner.parameters.BenchmarkParams;
 import org.openjdk.jmh.runner.parameters.IterationParams;
 
@@ -41,7 +42,7 @@
  */
 public class SilentFormat extends AbstractOutputFormat {
 
-    public SilentFormat(PrintStream out, boolean verbose) {
+    public SilentFormat(PrintStream out, VerboseMode verbose) {
         super(out, verbose);
     }
 
@@ -54,7 +55,7 @@
     }
 
     @Override
-    public void startBenchmark(BenchmarkRecord name, BenchmarkParams mbParams, boolean verbose) {
+    public void startBenchmark(BenchmarkRecord name, BenchmarkParams mbParams) {
 
     }
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/output/format/TextReportFormat.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/output/format/TextReportFormat.java	Fri Jan 10 15:54:51 2014 +0400
@@ -30,6 +30,7 @@
 import org.openjdk.jmh.logic.results.RunResult;
 import org.openjdk.jmh.profile.ProfilerResult;
 import org.openjdk.jmh.runner.BenchmarkRecord;
+import org.openjdk.jmh.runner.options.VerboseMode;
 import org.openjdk.jmh.runner.parameters.BenchmarkParams;
 import org.openjdk.jmh.runner.parameters.IterationParams;
 import org.openjdk.jmh.runner.parameters.TimeValue;
@@ -51,16 +52,12 @@
  */
 public class TextReportFormat extends AbstractOutputFormat {
 
-    public TextReportFormat(PrintStream out, boolean verbose) {
+    public TextReportFormat(PrintStream out, VerboseMode verbose) {
         super(out, verbose);
     }
 
     @Override
-    public void startBenchmark(BenchmarkRecord name, BenchmarkParams mbParams, boolean verbose) {
-        if (verbose) {
-            out.println("# Starting run at: " + new Date());
-        }
-
+    public void startBenchmark(BenchmarkRecord name, BenchmarkParams mbParams) {
         out.println("# Warmup: " + mbParams.getWarmup().getCount() + " iterations, " + mbParams.getWarmup().getTime() + " each");
         out.println("# Measurement: " + mbParams.getMeasurement().getCount() + " iterations, " + mbParams.getMeasurement().getTime() + " each");
         out.println("# Threads: " + mbParams.getThreads() + " " + getThreadsString(mbParams.getThreads()) + (mbParams.shouldSynchIterations() ? ", will synchronize iterations" : ""));
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/ProfilerType.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/ProfilerType.java	Fri Jan 10 15:54:51 2014 +0400
@@ -24,12 +24,14 @@
  */
 package org.openjdk.jmh.profile;
 
+import org.openjdk.jmh.runner.options.VerboseMode;
+
 public enum ProfilerType {
 
     GC {
         @Override
-        public Profiler createInstance(boolean verbose) {
-            return new GCProfiler(label(), verbose);
+        public Profiler createInstance(VerboseMode mode) {
+            return new GCProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
         }
 
         @Override
@@ -54,8 +56,8 @@
     },
     COMP {
         @Override
-        public Profiler createInstance(boolean verbose) {
-            return new CompilerProfiler(label(), verbose);
+        public Profiler createInstance(VerboseMode mode) {
+            return new CompilerProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
         }
 
         @Override
@@ -80,8 +82,8 @@
     },
     CL {
         @Override
-        public Profiler createInstance(boolean verbose) {
-            return new ClassloaderProfiler(label(), verbose);
+        public Profiler createInstance(VerboseMode mode) {
+            return new ClassloaderProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
         }
 
         @Override
@@ -116,8 +118,8 @@
         }
 
         @Override
-        public Profiler createInstance(boolean verbose) {
-            return new HotspotRuntimeProfiler(label(), verbose);
+        public Profiler createInstance(VerboseMode mode) {
+            return new HotspotRuntimeProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
         }
 
         @Override
@@ -132,8 +134,8 @@
     },
     HS_CL {
         @Override
-        public Profiler createInstance(boolean verbose) {
-            return new HotspotClassloadingProfiler(label(), verbose);
+        public Profiler createInstance(VerboseMode mode) {
+            return new HotspotClassloadingProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
         }
 
         @Override
@@ -168,8 +170,8 @@
         }
 
         @Override
-        public Profiler createInstance(boolean verbose) {
-            return new HotspotCompilationProfiler(label(), verbose);
+        public Profiler createInstance(VerboseMode mode) {
+            return new HotspotCompilationProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
         }
 
         @Override
@@ -194,8 +196,8 @@
         }
 
         @Override
-        public Profiler createInstance(boolean verbose) {
-            return new HotspotMemoryProfiler(label(), verbose);
+        public Profiler createInstance(VerboseMode mode) {
+            return new HotspotMemoryProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
         }
 
         @Override
@@ -220,8 +222,8 @@
         }
 
         @Override
-        public Profiler createInstance(boolean verbose) {
-            return new HotspotThreadProfiler(label(), verbose);
+        public Profiler createInstance(VerboseMode mode) {
+            return new HotspotThreadProfiler(label(), mode.equalsOrHigherThan(VerboseMode.Extra));
         }
 
         @Override
@@ -246,7 +248,7 @@
         }
 
         @Override
-        public Profiler createInstance(boolean verbose) {
+        public Profiler createInstance(VerboseMode mode) {
             return new StackProfiler(label());
         }
 
@@ -261,7 +263,7 @@
         }
     };
 
-    public abstract Profiler createInstance(boolean verbose);
+    public abstract Profiler createInstance(VerboseMode mode);
 
     public abstract boolean isSupported();
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseMicroBenchmarkHandler.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseMicroBenchmarkHandler.java	Fri Jan 10 15:54:51 2014 +0400
@@ -82,7 +82,7 @@
         List<Profiler> list = new ArrayList<Profiler>();
         // register the profilers
         for (ProfilerType prof : options.getProfilers()) {
-            list.add(prof.createInstance(options.isVerbose()));
+            list.add(prof.createInstance(options.verbosity()));
         }
         return list;
     }
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java	Fri Jan 10 15:54:51 2014 +0400
@@ -119,7 +119,7 @@
     protected BenchResult runBenchmark(BenchmarkParams executionParams, MicroBenchmarkHandler handler) {
         List<IterationResult> allResults = new ArrayList<IterationResult>();
 
-        out.startBenchmark(handler.getBenchmark(), executionParams, this.options.isVerbose());
+        out.startBenchmark(handler.getBenchmark(), executionParams);
 
         // warmup
         IterationParams wp = executionParams.getWarmup();
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/ForkedRunner.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/ForkedRunner.java	Fri Jan 10 15:54:51 2014 +0400
@@ -26,7 +26,7 @@
 
 import org.openjdk.jmh.link.BinaryLinkClient;
 import org.openjdk.jmh.logic.results.BenchResult;
-import org.openjdk.jmh.output.OutputFormatFactory;
+import org.openjdk.jmh.output.format.OutputFormatFactory;
 import org.openjdk.jmh.runner.options.Options;
 import org.openjdk.jmh.util.internal.Multimap;
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/Runner.java	Fri Jan 10 15:54:51 2014 +0400
@@ -30,11 +30,12 @@
 import org.openjdk.jmh.link.BinaryLinkServer;
 import org.openjdk.jmh.logic.results.BenchResult;
 import org.openjdk.jmh.logic.results.RunResult;
-import org.openjdk.jmh.output.OutputFormatFactory;
+import org.openjdk.jmh.output.format.OutputFormatFactory;
 import org.openjdk.jmh.output.format.OutputFormat;
 import org.openjdk.jmh.output.results.ResultFormat;
 import org.openjdk.jmh.output.results.ResultFormatFactory;
 import org.openjdk.jmh.runner.options.Options;
+import org.openjdk.jmh.runner.options.VerboseMode;
 import org.openjdk.jmh.runner.parameters.BenchmarkParams;
 import org.openjdk.jmh.util.AnnotationUtils;
 import org.openjdk.jmh.util.InputStreamDrainer;
@@ -55,7 +56,6 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
@@ -114,7 +114,7 @@
             }
         }
 
-        return OutputFormatFactory.createFormatInstance(out, options.getOutputFormat(), options.isVerbose());
+        return OutputFormatFactory.createFormatInstance(out, options.verbosity());
     }
 
     public void list() {
@@ -153,17 +153,19 @@
         SortedSet<BenchmarkRecord> benchmarks = list.find(out, options.getIncludes(), options.getExcludes());
 
         if (benchmarks.isEmpty()) {
-            out.println("No matching benchmarks. Miss-spelled regexp? Use -v for verbose output.");
+            out.println("No matching benchmarks. Miss-spelled regexp?");
+
+            if (options.verbosity() != VerboseMode.Extra) {
+                out.println("Use " + VerboseMode.Extra + " verbose mode to debug the pattern matching.");
+            } else {
+                list();
+            }
+
             out.flush();
             out.close();
             return null;
         }
 
-        // list microbenchmarks if -v
-        if (options.isVerbose()) {
-            list();
-        }
-
         // override the benchmark types;
         // this may yield new benchmark records
         if (options.getBenchModes() != null) {
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/ChainedOptionsBuilder.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/ChainedOptionsBuilder.java	Fri Jan 10 15:54:51 2014 +0400
@@ -25,7 +25,6 @@
 package org.openjdk.jmh.runner.options;
 
 import org.openjdk.jmh.annotations.Mode;
-import org.openjdk.jmh.output.OutputFormatType;
 import org.openjdk.jmh.output.results.ResultFormatType;
 import org.openjdk.jmh.profile.ProfilerType;
 import org.openjdk.jmh.runner.parameters.TimeValue;
@@ -59,13 +58,6 @@
     ChainedOptionsBuilder exclude(String regexp);
 
     /**
-     * OutputFormat to use in the run
-     * @param type outputformat type
-     * @return builder
-     */
-    ChainedOptionsBuilder outputFormat(OutputFormatType type);
-
-    /**
      * ResultFormatType to use in the run
      * @param type resultformat type
      * @return builder
@@ -101,11 +93,11 @@
     ChainedOptionsBuilder addProfiler(ProfilerType prof);
 
     /**
-     * Be extra verbose?
-     * @param value flag
+     * Control verbosity level.
+     * @param mode flag
      * @return builder
      */
-    ChainedOptionsBuilder verbose(boolean value);
+    ChainedOptionsBuilder verbosity(VerboseMode mode);
 
     /**
      * Should fail on first benchmark error?
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/CommandLineOptions.java	Fri Jan 10 15:54:51 2014 +0400
@@ -29,7 +29,6 @@
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.Option;
 import org.openjdk.jmh.annotations.Mode;
-import org.openjdk.jmh.output.OutputFormatType;
 import org.openjdk.jmh.output.results.ResultFormatType;
 import org.openjdk.jmh.profile.ProfilerType;
 import org.openjdk.jmh.runner.options.handlers.BenchmarkModeTypeOptionHandler;
@@ -104,8 +103,8 @@
     @Option(name = "-gc", usage = "Should do System.gc() between iterations?", handler = BooleanOptionHandler.class)
     protected boolean gcEachIteration = false;
 
-    @Option(name = "-v", aliases = {"--verbose"}, usage = "Verbose mode, default off", handler = BooleanOptionHandler.class)
-    protected boolean verbose = false;
+    @Option(name = "-v", aliases = {"--verbosity"}, metaVar = "LEVEL", usage = "Verbosity mode: (silent, normal, extra)")
+    protected VerboseMode verbose = VerboseMode.Normal;
 
     @Option(name = "-foe", usage = "Fail the harness on benchmark erro?", handler = BooleanOptionHandler.class)
     protected boolean failOnError = false;
@@ -134,9 +133,6 @@
     @Option(name = "-rff", aliases = {"--result"}, metaVar = "FILE", usage = "Redirect results to FILE")
     protected String result = Defaults.RESULT_FILE;
 
-    @Option(name = "-of", aliases = {"--outputformat"}, metaVar = "FORMAT", usage = "Format to use for output, use --listOutputFormats to list available formats")
-    protected OutputFormatType outputFormat = OutputFormatType.defaultType();
-
     @Option(name = "-rf", aliases = {"--resultformat"}, metaVar = "FORMAT", usage = "Format to use for results, use --listResultFormats to list available formats")
     protected ResultFormatType resultFormat = ResultFormatType.defaultType();
 
@@ -162,9 +158,6 @@
     @Option(name = "-l", aliases = {"--list"}, usage = "List available microbenchmarks and exit. Filter using available regexps.")
     protected boolean list = false;
 
-    @Option(name = "--listOutputFormats", usage = "List available output formats")
-    protected boolean listOutputFormats = false;
-
     @Option(name = "--listResultFormats", usage = "List available result formats")
     protected boolean listResultFormats = false;
 
@@ -326,16 +319,6 @@
         return output;
     }
 
-    /**
-     * Getter
-     *
-     * @return the value
-     */
-    @Override
-    public OutputFormatType getOutputFormat() {
-        return outputFormat;
-    }
-
     @Override
     public ResultFormatType getResultFormat() {
         return resultFormat;
@@ -346,15 +329,6 @@
         return result;
     }
 
-    /**
-     * Getter
-     *
-     * @return the value
-     */
-    public boolean shouldListOutputFormats() {
-        return listOutputFormats;
-    }
-
     public boolean shouldListResultFormats() {
         return listResultFormats;
     }
@@ -467,7 +441,7 @@
      * @return the value
      */
     @Override
-    public boolean isVerbose() {
+    public VerboseMode verbosity() {
         return verbose;
     }
 
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/Options.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/Options.java	Fri Jan 10 15:54:51 2014 +0400
@@ -25,7 +25,6 @@
 package org.openjdk.jmh.runner.options;
 
 import org.openjdk.jmh.annotations.Mode;
-import org.openjdk.jmh.output.OutputFormatType;
 import org.openjdk.jmh.output.results.ResultFormatType;
 import org.openjdk.jmh.profile.ProfilerType;
 import org.openjdk.jmh.runner.parameters.TimeValue;
@@ -50,12 +49,6 @@
     List<String> getExcludes();
 
     /**
-     * Output format to use
-     * @return format type
-     */
-    OutputFormatType getOutputFormat();
-
-    /**
      * Which file to use for dumping the output
      * @return file name; null if not defined
      */
@@ -86,10 +79,10 @@
     Collection<ProfilerType> getProfilers();
 
     /**
-     * Should be extra verbose?
-     * @return should be verbose?
+     * How verbose should we be?
+     * @return verbosity mode
      */
-    boolean isVerbose();
+    VerboseMode verbosity();
 
     /**
      * Should harness terminate on first error encountered?
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/options/OptionsBuilder.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/OptionsBuilder.java	Fri Jan 10 15:54:51 2014 +0400
@@ -25,7 +25,6 @@
 package org.openjdk.jmh.runner.options;
 
 import org.openjdk.jmh.annotations.Mode;
-import org.openjdk.jmh.output.OutputFormatType;
 import org.openjdk.jmh.output.results.ResultFormatType;
 import org.openjdk.jmh.profile.ProfilerType;
 import org.openjdk.jmh.runner.parameters.Defaults;
@@ -91,21 +90,6 @@
 
     // ---------------------------------------------------------------------------
 
-    private OutputFormatType ofType = OutputFormatType.defaultType();
-
-    @Override
-    public ChainedOptionsBuilder outputFormat(OutputFormatType type) {
-        ofType = type;
-        return this;
-    }
-
-    @Override
-    public OutputFormatType getOutputFormat() {
-        return ofType;
-    }
-
-    // ---------------------------------------------------------------------------
-
     private String output;
 
     @Override
@@ -181,17 +165,17 @@
 
     // ---------------------------------------------------------------------------
 
-    private boolean isVerbose;
+    private VerboseMode verbosity = VerboseMode.Normal;
 
     @Override
-    public ChainedOptionsBuilder verbose(boolean value) {
-        isVerbose = value;
+    public ChainedOptionsBuilder verbosity(VerboseMode mode) {
+        verbosity = mode;
         return this;
     }
 
     @Override
-    public boolean isVerbose() {
-        return isVerbose;
+    public VerboseMode verbosity() {
+        return verbosity;
     }
 
     // ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/options/VerboseMode.java	Fri Jan 10 15:54:51 2014 +0400
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package org.openjdk.jmh.runner.options;
+
+public enum VerboseMode {
+
+    /**
+     * Be completely silent.
+     */
+    Silent(0),
+
+    /**
+     * Output normally.
+     */
+    Normal(1),
+
+    /**
+     * Output extra info.
+     */
+    Extra(2),
+
+    ;
+
+    private final int level;
+
+    VerboseMode(int level) {
+        this.level = level;
+    }
+
+    public boolean equalsOrHigherThan(VerboseMode other) {
+        return level >= other.level;
+    }
+
+}
--- a/jmh-core/src/test/java/org/openjdk/jmh/runner/TestMicroBenchmarkList.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/test/java/org/openjdk/jmh/runner/TestMicroBenchmarkList.java	Fri Jan 10 15:54:51 2014 +0400
@@ -26,8 +26,9 @@
 
 import org.junit.BeforeClass;
 import org.junit.Test;
-import org.openjdk.jmh.output.OutputFormatFactory;
+import org.openjdk.jmh.output.format.OutputFormatFactory;
 import org.openjdk.jmh.output.format.OutputFormat;
+import org.openjdk.jmh.runner.options.VerboseMode;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -52,7 +53,7 @@
     public static void setUpClass() throws Exception {
         list = MicroBenchmarkList.fromResource("/org/openjdk/jmh/runner/MicroBenchmarks");
         excludes = new ArrayList<String>();
-        out = OutputFormatFactory.createFormatInstance(false);
+        out = OutputFormatFactory.createFormatInstance(System.out, VerboseMode.Normal);
     }
 
     @Test
--- a/jmh-core/src/test/java/org/openjdk/jmh/runner/options/TestOptions.java	Thu Jan 09 20:14:51 2014 +0400
+++ b/jmh-core/src/test/java/org/openjdk/jmh/runner/options/TestOptions.java	Fri Jan 10 15:54:51 2014 +0400
@@ -29,7 +29,6 @@
 import org.junit.Test;
 import org.openjdk.jmh.annotations.Mode;
 import org.openjdk.jmh.annotations.Threads;
-import org.openjdk.jmh.output.OutputFormatType;
 import org.openjdk.jmh.output.results.ResultFormatType;
 import org.openjdk.jmh.profile.ProfilerType;
 import org.openjdk.jmh.runner.parameters.TimeValue;
@@ -82,20 +81,6 @@
     }
 
     @Test
-    public void testOutputFormats() throws Exception {
-        for (OutputFormatType type : OutputFormatType.values()) {
-            CommandLineOptions cmdLine = getOptions(new String[]{ "-of", type.toString()});
-            Options builder = new OptionsBuilder().outputFormat(type).build();
-            Assert.assertEquals(builder.getOutputFormat(), cmdLine.getOutputFormat());
-        }
-    }
-
-    @Test
-    public void testOutputFormats_Default() throws Exception {
-        Assert.assertEquals(EMPTY_BUILDER.getOutputFormat(), EMPTY_CMDLINE.getOutputFormat());
-    }
-
-    @Test
     public void testOutput() throws Exception {
         CommandLineOptions cmdLine = getOptions(new String[]{"-o", "sample.out"});
         Options builder = new OptionsBuilder().output("sample.out").build();
@@ -173,29 +158,35 @@
     }
 
     @Test
-    public void testVerbose_Set() throws Exception {
-        CommandLineOptions cmdLine = getOptions(new String[]{"-v"});
-        Options builder = new OptionsBuilder().verbose(true).build();
-        Assert.assertEquals(builder.isVerbose(), cmdLine.isVerbose());
+    public void testVerbose() throws Exception {
+        for (VerboseMode mode : VerboseMode.values()) {
+            CommandLineOptions cmdLine = getOptions(new String[]{"-v", mode.toString()});
+            Options builder = new OptionsBuilder().verbosity(mode).build();
+            Assert.assertEquals(builder.verbosity(), cmdLine.verbosity());
+        }
     }
 
     @Test
-    public void testVerbose_True() throws Exception {
-        CommandLineOptions cmdLine = getOptions(new String[]{"-v", "true"});
-        Options builder = new OptionsBuilder().verbose(true).build();
-        Assert.assertEquals(builder.isVerbose(), cmdLine.isVerbose());
+    public void testVerbose_LC() throws Exception {
+        for (VerboseMode mode : VerboseMode.values()) {
+            CommandLineOptions cmdLine = getOptions(new String[]{"-v", mode.toString().toLowerCase()});
+            Options builder = new OptionsBuilder().verbosity(mode).build();
+            Assert.assertEquals(builder.verbosity(), cmdLine.verbosity());
+        }
     }
 
     @Test
-    public void testVerbose_False() throws Exception {
-        CommandLineOptions cmdLine = getOptions(new String[]{"-v", "false"});
-        Options builder = new OptionsBuilder().verbose(false).build();
-        Assert.assertEquals(builder.isVerbose(), cmdLine.isVerbose());
+    public void testVerbose_UC() throws Exception {
+        for (VerboseMode mode : VerboseMode.values()) {
+            CommandLineOptions cmdLine = getOptions(new String[]{"-v", mode.toString().toUpperCase()});
+            Options builder = new OptionsBuilder().verbosity(mode).build();
+            Assert.assertEquals(builder.verbosity(), cmdLine.verbosity());
+        }
     }
 
     @Test
     public void testVerbose_Default() throws Exception {
-        Assert.assertEquals(EMPTY_BUILDER.isVerbose(), EMPTY_CMDLINE.isVerbose());
+        Assert.assertEquals(EMPTY_BUILDER.verbosity(), EMPTY_CMDLINE.verbosity());
     }
 
     @Test