changeset 1316:bedb56cf476f

7901650: Warn harder about non-forked runs
author shade
date Thu, 31 Mar 2016 19:37:44 +0300
parents 6b825c9b1c94
children eb41bdab96cf
files jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java	Thu Mar 31 14:06:43 2016 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java	Thu Mar 31 19:37:44 2016 +0300
@@ -84,11 +84,7 @@
             BenchmarkParams params = action.getParams();
             ActionMode mode = action.getMode();
 
-            String opts = Utils.join(params.getJvmArgs(), " ").trim();
             String realOpts = Utils.join(ManagementFactory.getRuntimeMXBean().getInputArguments(), " ").trim();
-            if (opts.isEmpty()) {
-                opts = "<none>";
-            }
             if (realOpts.isEmpty()) {
                 realOpts = "<none>";
             }
@@ -96,12 +92,14 @@
             out.println("# " + Version.getVersion());
             out.println("# VM version: " + Utils.getCurrentJvmVersion());
             out.println("# VM invoker: " + Utils.getCurrentJvm());
-            out.println("# VM options: " + realOpts + (opts.equals(realOpts) ? "" : " *** WARNING: some JVM options are ignored in non-forked runs ***"));
+            out.println("# VM options: " + realOpts);
 
             out.startBenchmark(params);
             out.println("");
             etaBeforeBenchmark();
-            out.println("# Fork: N/A, test runs in the existing VM");
+            out.println("# Fork: N/A, test runs in the host VM");
+            out.println("# *** WARNING: Non-forked runs may silently omit JVM options, mess up profilers, disable compiler hints, etc. ***");
+            out.println("# *** WARNING: Use non-forked runs only for debugging purposes, not for actual performance runs. ***");
 
             final List<IterationResult> res = new ArrayList<IterationResult>();
             final List<BenchmarkResultMetaData> mds = new ArrayList<BenchmarkResultMetaData>();