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.jfr.consumer.RecordedEvent;
36 import jdk.test.lib.Asserts;
37 import jdk.test.lib.jfr.EventNames;
38 import jdk.test.lib.jfr.Events;
39 import jdk.test.lib.jfr.SimpleEvent;
40 import jdk.test.lib.jfr.SimpleEventHelper;
41
42 /*
43 * @test
44 * @summary Enable, disable, enable event during recording.
45 * @key jfr
46 * @library /test/lib
47 * @run main/othervm jdk.jfr.api.recording.event.TestReEnableMultiple
48 */
49 public class TestReEnableMultiple {
50 private static final String EVENT_PATH = EventNames.FileWrite;
51 private static final Random rand = new Random(0);
52
53 public static void main(String[] args) throws Throwable {
54 Recording rA = new Recording();
55 Recording rB = new Recording();
56
57 final Path path = Paths.get(".", "dummy.txt").toAbsolutePath();
58 rA.start();
59 rB.start();
60
61 SimpleEventHelper.enable(rA, false);
62 SimpleEventHelper.enable(rA, false);
63
64 int expectedMyEvents = 0;
65 int expectedIoEvents = 0;
|
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.jfr.consumer.RecordedEvent;
36 import jdk.test.lib.Asserts;
37 import jdk.test.lib.jfr.EventNames;
38 import jdk.test.lib.jfr.Events;
39 import jdk.test.lib.jfr.SimpleEvent;
40 import jdk.test.lib.jfr.SimpleEventHelper;
41
42 /**
43 * @test
44 * @summary Enable, disable, enable event during recording.
45 * @key jfr
46 * @requires vm.hasJFR
47 * @library /test/lib
48 * @run main/othervm jdk.jfr.api.recording.event.TestReEnableMultiple
49 */
50 public class TestReEnableMultiple {
51 private static final String EVENT_PATH = EventNames.FileWrite;
52 private static final Random rand = new Random(0);
53
54 public static void main(String[] args) throws Throwable {
55 Recording rA = new Recording();
56 Recording rB = new Recording();
57
58 final Path path = Paths.get(".", "dummy.txt").toAbsolutePath();
59 rA.start();
60 rB.start();
61
62 SimpleEventHelper.enable(rA, false);
63 SimpleEventHelper.enable(rA, false);
64
65 int expectedMyEvents = 0;
66 int expectedIoEvents = 0;
|