changeset 113:474e029b1134

Port bulk warmup integration tests towards @GMB.
author shade
date Fri, 16 Aug 2013 17:46:33 +0400
parents fcd8d6c58998
children 810907f82c45
files jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode0_Test.java jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode1_Test.java jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode2_Test.java jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode3_Test.java jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode4_Test.java jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode5_Test.java jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode6_Test.java jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode7_Test.java jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode8_Test.java jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest0.java jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest1.java jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest2.java jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest3.java jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest4.java jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest5.java jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest6.java jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest7.java jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest8.java jmh-core/src/main/java/org/openjdk/jmh/logic/Control.java jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java
diffstat 20 files changed, 957 insertions(+), 913 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode0_Test.java	Fri Aug 16 17:46:33 2013 +0400
@@ -0,0 +1,105 @@
+/*
+ * 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.it.bulkwarmup;
+
+
+import org.junit.Test;
+import org.openjdk.jmh.Main;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.logic.Control;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Tests if harness honors warmup command line settings like:
+ * -wmb
+ * -wm
+ * -frw
+ * ....
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+@State(Scope.Thread)
+public class WarmupMode0_Test {
+
+    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
+
+    boolean recorded;
+
+    @Setup(Level.Iteration)
+    public void oneShot() {
+        recorded = false;
+    }
+
+    @GenerateMicroBenchmark
+    public void testBig(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("W");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("I");
+            }
+        }
+        Fixtures.work();
+    }
+
+    @GenerateMicroBenchmark
+    public void testSmall(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("w");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("i");
+            }
+        }
+        Fixtures.work();
+    }
+
+    private static String getSequence() {
+        StringBuilder sb = new StringBuilder();
+        for (String s : testSequence) {
+            sb.append(s);
+        }
+        return sb.toString();
+    }
+
+    @Test
+    public void invoke0() {
+        testSequence.clear();
+        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testBig.* -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -f false -si false");
+        assertEquals("WWI", getSequence());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode1_Test.java	Fri Aug 16 17:46:33 2013 +0400
@@ -0,0 +1,104 @@
+/*
+ * 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.it.bulkwarmup;
+
+
+import org.junit.Test;
+import org.openjdk.jmh.Main;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.logic.Control;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Tests if harness honors warmup command line settings like:
+ * -wmb
+ * -wm
+ * -frw
+ * ....
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+@State(Scope.Thread)
+public class WarmupMode1_Test {
+
+    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
+
+    boolean recorded;
+
+    @Setup(Level.Iteration)
+    public void oneShot() {
+        recorded = false;
+    }
+
+    @GenerateMicroBenchmark
+    public void testBig(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("W");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("I");
+            }
+        }
+        Fixtures.work();
+    }
+
+    @GenerateMicroBenchmark
+    public void testSmall(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("w");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("i");
+            }
+        }
+        Fixtures.work();
+    }
+
+    private static String getSequence() {
+        StringBuilder sb = new StringBuilder();
+        for (String s : testSequence) {
+            sb.append(s);
+        }
+        return sb.toString();
+    }
+
+    @Test
+    public void invoke1() {
+        testSequence.clear();
+        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testSmall.* -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -f false -si false");
+        assertEquals("wwi", getSequence());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode2_Test.java	Fri Aug 16 17:46:33 2013 +0400
@@ -0,0 +1,104 @@
+/*
+ * 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.it.bulkwarmup;
+
+
+import org.junit.Test;
+import org.openjdk.jmh.Main;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.logic.Control;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Tests if harness honors warmup command line settings like:
+ * -wmb
+ * -wm
+ * -frw
+ * ....
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+@State(Scope.Thread)
+public class WarmupMode2_Test {
+
+    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
+
+    boolean recorded;
+
+    @Setup(Level.Iteration)
+    public void oneShot() {
+        recorded = false;
+    }
+
+    @GenerateMicroBenchmark
+    public void testBig(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("W");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("I");
+            }
+        }
+        Fixtures.work();
+    }
+
+    @GenerateMicroBenchmark
+    public void testSmall(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("w");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("i");
+            }
+        }
+        Fixtures.work();
+    }
+
+    private static String getSequence() {
+        StringBuilder sb = new StringBuilder();
+        for (String s : testSequence) {
+            sb.append(s);
+        }
+        return sb.toString();
+    }
+
+    @Test
+    public void invoke2() {
+        testSequence.clear();
+        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testBig.* -foe -w 1 -r 2 -t 2 -i 1 -wi 2 -f false -si false");
+        assertEquals("WWWWII", getSequence());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode3_Test.java	Fri Aug 16 17:46:33 2013 +0400
@@ -0,0 +1,104 @@
+/*
+ * 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.it.bulkwarmup;
+
+
+import org.junit.Test;
+import org.openjdk.jmh.Main;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.logic.Control;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Tests if harness honors warmup command line settings like:
+ * -wmb
+ * -wm
+ * -frw
+ * ....
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+@State(Scope.Thread)
+public class WarmupMode3_Test {
+
+    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
+
+    boolean recorded;
+
+    @Setup(Level.Iteration)
+    public void oneShot() {
+        recorded = false;
+    }
+
+    @GenerateMicroBenchmark
+    public void testBig(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("W");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("I");
+            }
+        }
+        Fixtures.work();
+    }
+
+    @GenerateMicroBenchmark
+    public void testSmall(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("w");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("i");
+            }
+        }
+        Fixtures.work();
+    }
+
+    private static String getSequence() {
+        StringBuilder sb = new StringBuilder();
+        for (String s : testSequence) {
+            sb.append(s);
+        }
+        return sb.toString();
+    }
+
+    @Test
+    public void invoke3() {
+        testSequence.clear();
+        Main.testMain(Fixtures.getTestMask(this.getClass()) + "  -foe -w 1 -r 2 -t 2 -i 1 -wi 2 -f false -si false");
+        assertEquals("WWWWIIwwwwii", getSequence());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode4_Test.java	Fri Aug 16 17:46:33 2013 +0400
@@ -0,0 +1,104 @@
+/*
+ * 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.it.bulkwarmup;
+
+
+import org.junit.Test;
+import org.openjdk.jmh.Main;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.logic.Control;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Tests if harness honors warmup command line settings like:
+ * -wmb
+ * -wm
+ * -frw
+ * ....
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+@State(Scope.Thread)
+public class WarmupMode4_Test {
+
+    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
+
+    boolean recorded;
+
+    @Setup(Level.Iteration)
+    public void oneShot() {
+        recorded = false;
+    }
+
+    @GenerateMicroBenchmark
+    public void testBig(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("W");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("I");
+            }
+        }
+        Fixtures.work();
+    }
+
+    @GenerateMicroBenchmark
+    public void testSmall(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("w");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("i");
+            }
+        }
+        Fixtures.work();
+    }
+
+    private static String getSequence() {
+        StringBuilder sb = new StringBuilder();
+        for (String s : testSequence) {
+            sb.append(s);
+        }
+        return sb.toString();
+    }
+
+    @Test
+    public void invoke4() {
+        testSequence.clear();
+        Main.testMain(Fixtures.getTestMask(this.getClass()) + "  -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -f false -si false");
+        assertEquals("WWIwwi", getSequence());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode5_Test.java	Fri Aug 16 17:46:33 2013 +0400
@@ -0,0 +1,105 @@
+/*
+ * 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.it.bulkwarmup;
+
+
+import org.junit.Test;
+import org.openjdk.jmh.Main;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.logic.Control;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Tests if harness honors warmup command line settings like:
+ * -wmb
+ * -wm
+ * -frw
+ * ....
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+@State(Scope.Thread)
+public class WarmupMode5_Test {
+
+    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
+
+    boolean recorded;
+
+    @Setup(Level.Iteration)
+    public void oneShot() {
+        recorded = false;
+    }
+
+    @GenerateMicroBenchmark
+    public void testBig(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("W");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("I");
+            }
+        }
+        Fixtures.work();
+    }
+
+    @GenerateMicroBenchmark
+    public void testSmall(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("w");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("i");
+            }
+        }
+        Fixtures.work();
+    }
+
+    private static String getSequence() {
+        StringBuilder sb = new StringBuilder();
+        for (String s : testSequence) {
+            sb.append(s);
+        }
+        return sb.toString();
+    }
+
+    @Test
+    public void invoke5() {
+        testSequence.clear();
+        Main.testMain(Fixtures.getTestMask(this.getClass()) + "  -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -wm beforeeach -f false -si false");
+        assertEquals("WWIwwi", getSequence());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode6_Test.java	Fri Aug 16 17:46:33 2013 +0400
@@ -0,0 +1,109 @@
+/*
+ * 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.it.bulkwarmup;
+
+
+import org.junit.Test;
+import org.openjdk.jmh.Main;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.MicroBenchmark;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.logic.Control;
+import org.openjdk.jmh.logic.Loop;
+import org.openjdk.jmh.logic.results.AverageTimePerOp;
+import org.openjdk.jmh.logic.results.Result;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.TimeUnit;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Tests if harness honors warmup command line settings like:
+ * -wmb
+ * -wm
+ * -frw
+ * ....
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+@State(Scope.Thread)
+public class WarmupMode6_Test {
+
+    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
+
+    boolean recorded;
+
+    @Setup(Level.Iteration)
+    public void oneShot() {
+        recorded = false;
+    }
+
+    @GenerateMicroBenchmark
+    public void testBig(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("W");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("I");
+            }
+        }
+        Fixtures.work();
+    }
+
+    @GenerateMicroBenchmark
+    public void testSmall(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("w");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("i");
+            }
+        }
+        Fixtures.work();
+    }
+
+    private static String getSequence() {
+        StringBuilder sb = new StringBuilder();
+        for (String s : testSequence) {
+            sb.append(s);
+        }
+        return sb.toString();
+    }
+
+    @Test
+    public void invoke6() {
+        testSequence.clear();
+        Main.testMain(Fixtures.getTestMask(this.getClass()) + "  -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -wm beforeany -f false -si false");
+        assertEquals("WWwwIi", getSequence());
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode7_Test.java	Fri Aug 16 17:46:33 2013 +0400
@@ -0,0 +1,105 @@
+/*
+ * 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.it.bulkwarmup;
+
+
+import org.junit.Test;
+import org.openjdk.jmh.Main;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.logic.Control;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Tests if harness honors warmup command line settings like:
+ * -wmb
+ * -wm
+ * -frw
+ * ....
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+@State(Scope.Thread)
+public class WarmupMode7_Test {
+
+    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
+
+    boolean recorded;
+
+    @Setup(Level.Iteration)
+    public void oneShot() {
+        recorded = false;
+    }
+
+    @GenerateMicroBenchmark
+    public void testBig(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("W");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("I");
+            }
+        }
+        Fixtures.work();
+    }
+
+    @GenerateMicroBenchmark
+    public void testSmall(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("w");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("i");
+            }
+        }
+        Fixtures.work();
+    }
+
+    private static String getSequence() {
+        StringBuilder sb = new StringBuilder();
+        for (String s : testSequence) {
+            sb.append(s);
+        }
+        return sb.toString();
+    }
+
+    @Test
+    public void invoke7() {
+        testSequence.clear();
+        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testBig.* -foe -w 1 -r 2 -tc 1,2,3 -i 1 -wi 2 -f false -si false");
+        assertEquals("WWIIIIII", getSequence());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/jmh-core-it/src/test/java/org/openjdk/jmh/it/bulkwarmup/WarmupMode8_Test.java	Fri Aug 16 17:46:33 2013 +0400
@@ -0,0 +1,105 @@
+/*
+ * 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.it.bulkwarmup;
+
+
+import org.junit.Test;
+import org.openjdk.jmh.Main;
+import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
+import org.openjdk.jmh.annotations.Level;
+import org.openjdk.jmh.annotations.Scope;
+import org.openjdk.jmh.annotations.Setup;
+import org.openjdk.jmh.annotations.State;
+import org.openjdk.jmh.it.Fixtures;
+import org.openjdk.jmh.logic.Control;
+
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
+
+import static junit.framework.Assert.assertEquals;
+
+/**
+ * Tests if harness honors warmup command line settings like:
+ * -wmb
+ * -wm
+ * -frw
+ * ....
+ *
+ * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
+ */
+@State(Scope.Thread)
+public class WarmupMode8_Test {
+
+    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
+
+    boolean recorded;
+
+    @Setup(Level.Iteration)
+    public void oneShot() {
+        recorded = false;
+    }
+
+    @GenerateMicroBenchmark
+    public void testBig(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("W");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("I");
+            }
+        }
+        Fixtures.work();
+    }
+
+    @GenerateMicroBenchmark
+    public void testSmall(Control cnt) {
+        if (!recorded) {
+            recorded = true;
+            if (cnt.iterationTime == 1000) { // warmup
+                testSequence.add("w");
+            } else if (cnt.iterationTime == 2000) {  // iteration
+                testSequence.add("i");
+            }
+        }
+        Fixtures.work();
+    }
+
+    private static String getSequence() {
+        StringBuilder sb = new StringBuilder();
+        for (String s : testSequence) {
+            sb.append(s);
+        }
+        return sb.toString();
+    }
+
+    @Test
+    public void invoke8() {
+        testSequence.clear();
+        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testBig.* -foe -w 1 -r 2 -tc 1,2,3 -i 1 -wi 2 -frw -f false -si false");
+        assertEquals("WWIWWWWIIWWWWWWIII", getSequence());
+    }
+
+}
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest0.java	Fri Aug 16 11:58:40 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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.it.generated;
-
-
-import org.junit.Test;
-import org.openjdk.jmh.Main;
-import org.openjdk.jmh.annotations.MicroBenchmark;
-import org.openjdk.jmh.it.Fixtures;
-import org.openjdk.jmh.logic.Loop;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.Result;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Tests if harness honors warmup command line settings like:
- * -wmb
- * -wm
- * -frw
- * ....
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class GeneratedWarmupModeTest0 {
-
-    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
-
-    @MicroBenchmark
-    public Result testBig(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("W");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("I");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    @MicroBenchmark
-    public Result testSmall(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("w");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("i");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    private static String getSequence() {
-        StringBuilder sb = new StringBuilder();
-        for (String s : testSequence) {
-            sb.append(s);
-        }
-        return sb.toString();
-    }
-
-    @Test
-    public void invoke0() {
-        testSequence.clear();
-        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testBig.* -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -f false");
-        assertEquals("WWI", getSequence());
-    }
-
-}
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest1.java	Fri Aug 16 11:58:40 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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.it.generated;
-
-
-import org.junit.Test;
-import org.openjdk.jmh.Main;
-import org.openjdk.jmh.annotations.MicroBenchmark;
-import org.openjdk.jmh.it.Fixtures;
-import org.openjdk.jmh.logic.Loop;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.Result;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Tests if harness honors warmup command line settings like:
- * -wmb
- * -wm
- * -frw
- * ....
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class GeneratedWarmupModeTest1 {
-
-    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
-
-    @MicroBenchmark
-    public Result testBig(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("W");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("I");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    @MicroBenchmark
-    public Result testSmall(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("w");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("i");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    private static String getSequence() {
-        StringBuilder sb = new StringBuilder();
-        for (String s : testSequence) {
-            sb.append(s);
-        }
-        return sb.toString();
-    }
-
-    @Test
-    public void invoke1() {
-        testSequence.clear();
-        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testSmall.* -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -f false");
-        assertEquals("wwi", getSequence());
-    }
-}
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest2.java	Fri Aug 16 11:58:40 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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.it.generated;
-
-
-import org.junit.Test;
-import org.openjdk.jmh.Main;
-import org.openjdk.jmh.annotations.MicroBenchmark;
-import org.openjdk.jmh.it.Fixtures;
-import org.openjdk.jmh.logic.Loop;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.Result;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Tests if harness honors warmup command line settings like:
- * -wmb
- * -wm
- * -frw
- * ....
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class GeneratedWarmupModeTest2 {
-
-    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
-
-    @MicroBenchmark
-    public Result testBig(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("W");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("I");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    @MicroBenchmark
-    public Result testSmall(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("w");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("i");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    private static String getSequence() {
-        StringBuilder sb = new StringBuilder();
-        for (String s : testSequence) {
-            sb.append(s);
-        }
-        return sb.toString();
-    }
-
-    @Test
-    public void invoke2() {
-        testSequence.clear();
-        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testBig.* -foe -w 1 -r 2 -t 2 -i 1 -wi 2 -f false");
-        assertEquals("WWWWII", getSequence());
-    }
-}
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest3.java	Fri Aug 16 11:58:40 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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.it.generated;
-
-
-import org.junit.Test;
-import org.openjdk.jmh.Main;
-import org.openjdk.jmh.annotations.MicroBenchmark;
-import org.openjdk.jmh.it.Fixtures;
-import org.openjdk.jmh.logic.Loop;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.Result;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Tests if harness honors warmup command line settings like:
- * -wmb
- * -wm
- * -frw
- * ....
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class GeneratedWarmupModeTest3 {
-
-    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
-
-    @MicroBenchmark
-    public Result testBig(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("W");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("I");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    @MicroBenchmark
-    public Result testSmall(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("w");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("i");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    private static String getSequence() {
-        StringBuilder sb = new StringBuilder();
-        for (String s : testSequence) {
-            sb.append(s);
-        }
-        return sb.toString();
-    }
-
-    @Test
-    public void invoke3() {
-        testSequence.clear();
-        Main.testMain(Fixtures.getTestMask(this.getClass()) + "  -foe -w 1 -r 2 -t 2 -i 1 -wi 2 -f false");
-        assertEquals("WWWWIIwwwwii", getSequence());
-    }
-}
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest4.java	Fri Aug 16 11:58:40 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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.it.generated;
-
-
-import org.junit.Test;
-import org.openjdk.jmh.Main;
-import org.openjdk.jmh.annotations.MicroBenchmark;
-import org.openjdk.jmh.it.Fixtures;
-import org.openjdk.jmh.logic.Loop;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.Result;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Tests if harness honors warmup command line settings like:
- * -wmb
- * -wm
- * -frw
- * ....
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class GeneratedWarmupModeTest4 {
-
-    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
-
-    @MicroBenchmark
-    public Result testBig(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("W");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("I");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    @MicroBenchmark
-    public Result testSmall(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("w");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("i");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    private static String getSequence() {
-        StringBuilder sb = new StringBuilder();
-        for (String s : testSequence) {
-            sb.append(s);
-        }
-        return sb.toString();
-    }
-
-    @Test
-    public void invoke4() {
-        testSequence.clear();
-        Main.testMain(Fixtures.getTestMask(this.getClass()) + "  -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -f false");
-        assertEquals("WWIwwi", getSequence());
-    }
-}
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest5.java	Fri Aug 16 11:58:40 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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.it.generated;
-
-
-import org.junit.Test;
-import org.openjdk.jmh.Main;
-import org.openjdk.jmh.annotations.MicroBenchmark;
-import org.openjdk.jmh.it.Fixtures;
-import org.openjdk.jmh.logic.Loop;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.Result;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Tests if harness honors warmup command line settings like:
- * -wmb
- * -wm
- * -frw
- * ....
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class GeneratedWarmupModeTest5 {
-
-    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
-
-    @MicroBenchmark
-    public Result testBig(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("W");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("I");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    @MicroBenchmark
-    public Result testSmall(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("w");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("i");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    private static String getSequence() {
-        StringBuilder sb = new StringBuilder();
-        for (String s : testSequence) {
-            sb.append(s);
-        }
-        return sb.toString();
-    }
-
-    @Test
-    public void invoke5() {
-        testSequence.clear();
-        Main.testMain(Fixtures.getTestMask(this.getClass()) + "  -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -wm beforeeach -f false");
-        assertEquals("WWIwwi", getSequence());
-    }
-
-}
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest6.java	Fri Aug 16 11:58:40 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +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.it.generated;
-
-
-import org.junit.Test;
-import org.openjdk.jmh.Main;
-import org.openjdk.jmh.annotations.MicroBenchmark;
-import org.openjdk.jmh.it.Fixtures;
-import org.openjdk.jmh.logic.Loop;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.Result;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Tests if harness honors warmup command line settings like:
- * -wmb
- * -wm
- * -frw
- * ....
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class GeneratedWarmupModeTest6 {
-
-    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
-
-    @MicroBenchmark
-    public Result testBig(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("W");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("I");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    @MicroBenchmark
-    public Result testSmall(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("w");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("i");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    private static String getSequence() {
-        StringBuilder sb = new StringBuilder();
-        for (String s : testSequence) {
-            sb.append(s);
-        }
-        return sb.toString();
-    }
-
-    @Test
-    public void invoke6() {
-        testSequence.clear();
-        Main.testMain(Fixtures.getTestMask(this.getClass()) + "  -foe -w 1 -r 2 -t 1 -i 1 -wi 2 -wm beforeany -f false");
-        assertEquals("WWwwIi", getSequence());
-    }
-}
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest7.java	Fri Aug 16 11:58:40 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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.it.generated;
-
-
-import org.junit.Test;
-import org.openjdk.jmh.Main;
-import org.openjdk.jmh.annotations.MicroBenchmark;
-import org.openjdk.jmh.it.Fixtures;
-import org.openjdk.jmh.logic.Loop;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.Result;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Tests if harness honors warmup command line settings like:
- * -wmb
- * -wm
- * -frw
- * ....
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class GeneratedWarmupModeTest7 {
-
-    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
-
-    @MicroBenchmark
-    public Result testBig(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("W");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("I");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    @MicroBenchmark
-    public Result testSmall(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("w");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("i");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    private static String getSequence() {
-        StringBuilder sb = new StringBuilder();
-        for (String s : testSequence) {
-            sb.append(s);
-        }
-        return sb.toString();
-    }
-
-    @Test
-    public void invoke7() {
-        testSequence.clear();
-        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testBig.* -foe -w 1 -r 2 -tc 1,2,3 -i 1 -wi 2 -f false");
-        assertEquals("WWIIIIII", getSequence());
-    }
-
-}
--- a/jmh-core-it/src/test/java/org/openjdk/jmh/it/generated/GeneratedWarmupModeTest8.java	Fri Aug 16 11:58:40 2013 +0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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.it.generated;
-
-
-import org.junit.Test;
-import org.openjdk.jmh.Main;
-import org.openjdk.jmh.annotations.MicroBenchmark;
-import org.openjdk.jmh.it.Fixtures;
-import org.openjdk.jmh.logic.Loop;
-import org.openjdk.jmh.logic.results.AverageTimePerOp;
-import org.openjdk.jmh.logic.results.Result;
-
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * Tests if harness honors warmup command line settings like:
- * -wmb
- * -wm
- * -frw
- * ....
- *
- * @author Sergey Kuksenko (sergey.kuksenko@oracle.com)
- */
-public class GeneratedWarmupModeTest8 {
-
-    private static Queue<String> testSequence = new ConcurrentLinkedQueue<String>();
-
-    @MicroBenchmark
-    public Result testBig(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("W");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("I");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    @MicroBenchmark
-    public Result testSmall(Loop loop) {
-        if (loop.getDuration() == 1000) { // warmup
-            testSequence.add("w");
-        } else if (loop.getDuration() == 2000) {  // iteration
-            testSequence.add("i");
-        }
-        loop.start();
-        while (!loop.done()) {
-            Fixtures.work();
-        }
-
-        return new AverageTimePerOp("test", 1, 42, TimeUnit.NANOSECONDS);
-    }
-
-
-    private static String getSequence() {
-        StringBuilder sb = new StringBuilder();
-        for (String s : testSequence) {
-            sb.append(s);
-        }
-        return sb.toString();
-    }
-
-    @Test
-    public void invoke8() {
-        testSequence.clear();
-        Main.testMain(Fixtures.getTestMask(this.getClass()) + ".testBig.* -foe -w 1 -r 2 -tc 1,2,3 -i 1 -wi 2 -frw -f false");
-        assertEquals("WWIWWWWIIWWWWWWIII", getSequence());
-    }
-
-}
--- a/jmh-core/src/main/java/org/openjdk/jmh/logic/Control.java	Fri Aug 16 11:58:40 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/logic/Control.java	Fri Aug 16 17:46:33 2013 +0400
@@ -29,6 +29,10 @@
 import org.openjdk.jmh.annotations.Setup;
 import org.openjdk.jmh.annotations.State;
 
+/**
+ * Control object, used to communicate significant information from JMH to the benchmark.
+ * WARNING: The API for this class is considered unstable, and can be changed without notice.
+ */
 @State(Scope.Benchmark)
 public class Control {
 
@@ -48,4 +52,9 @@
      */
     public volatile boolean stopMeasurement;
 
+    /**
+     * Iteration time
+     */
+    public volatile long iterationTime;
+
 }
--- a/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Fri Aug 16 11:58:40 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Fri Aug 16 17:46:33 2013 +0400
@@ -722,6 +722,7 @@
             // control objects get a special treatment
             for (StateObject so : states.getControls()) {
                 writer.println(ident(3) + so.localIdentifier + ".startMeasurement = true;");
+                writer.println(ident(3) + so.localIdentifier + ".iterationTime = loop.getDuration();");
             }
 
             // measurement loop call
@@ -811,6 +812,7 @@
             // control objects get a special treatment
             for (StateObject so : states.getControls()) {
                 writer.println(ident(3) + so.localIdentifier + ".startMeasurement = true;");
+                writer.println(ident(3) + so.localIdentifier + ".iterationTime = loop.getDuration();");
             }
 
             // measurement loop call
@@ -921,6 +923,7 @@
             // control objects get a special treatment
             for (StateObject so : states.getControls()) {
                 writer.println(ident(3) + so.localIdentifier + ".startMeasurement = true;");
+                writer.println(ident(3) + so.localIdentifier + ".iterationTime = loop.getDuration();");
             }
 
             // measurement loop call