< prev index next >

test/jdk/jdk/jfr/api/recording/event/TestRecordingEnableDisable.java

Print this page
rev 51054 : imported patch 9000013-aixDisableJFR-requires.patch


  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package jdk.jfr.api.recording.event;
  27 
  28 import java.nio.file.Files;
  29 import java.nio.file.Path;
  30 import java.nio.file.Paths;
  31 import java.util.Random;
  32 
  33 import jdk.jfr.EventType;
  34 import jdk.jfr.Recording;
  35 import jdk.test.lib.Asserts;
  36 import jdk.test.lib.jfr.SimpleEvent;
  37 import jdk.test.lib.jfr.SimpleEventHelper;
  38 
  39 /*
  40  * @test
  41  * @summary Enable, disable, enable event during recording.
  42  * @key jfr

  43  * @library /test/lib
  44  * @run main/othervm jdk.jfr.api.recording.event.TestRecordingEnableDisable
  45  */
  46 public class TestRecordingEnableDisable {
  47     private static final String EVENT_PATH = "java.file_write";
  48     private static final Random rand = new Random(0);
  49 
  50     public static void main(String[] args) throws Throwable {
  51 
  52         Recording rA = new Recording();
  53         Recording rB = new Recording();
  54 
  55         rA.setName("rA");
  56         rB.setName("rB");
  57 
  58         final Path path = Paths.get(".", "my.jfr");
  59         rA.start();
  60         rB.start();
  61 
  62         for (int i = 0; i < 30; ++i) {




  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package jdk.jfr.api.recording.event;
  27 
  28 import java.nio.file.Files;
  29 import java.nio.file.Path;
  30 import java.nio.file.Paths;
  31 import java.util.Random;
  32 
  33 import jdk.jfr.EventType;
  34 import jdk.jfr.Recording;
  35 import jdk.test.lib.Asserts;
  36 import jdk.test.lib.jfr.SimpleEvent;
  37 import jdk.test.lib.jfr.SimpleEventHelper;
  38 
  39 /**
  40  * @test
  41  * @summary Enable, disable, enable event during recording.
  42  * @key jfr
  43  * @requires vm.hasJFR
  44  * @library /test/lib
  45  * @run main/othervm jdk.jfr.api.recording.event.TestRecordingEnableDisable
  46  */
  47 public class TestRecordingEnableDisable {
  48     private static final String EVENT_PATH = "java.file_write";
  49     private static final Random rand = new Random(0);
  50 
  51     public static void main(String[] args) throws Throwable {
  52 
  53         Recording rA = new Recording();
  54         Recording rB = new Recording();
  55 
  56         rA.setName("rA");
  57         rB.setName("rB");
  58 
  59         final Path path = Paths.get(".", "my.jfr");
  60         rA.start();
  61         rB.start();
  62 
  63         for (int i = 0; i < 30; ++i) {


< prev index next >