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.destination;
27
28 import java.nio.file.Files;
29 import java.nio.file.Path;
30 import java.nio.file.Paths;
31 import java.util.List;
32
33 import jdk.jfr.Recording;
34 import jdk.jfr.consumer.RecordedEvent;
35 import jdk.jfr.consumer.RecordingFile;
36 import jdk.test.lib.Asserts;
37 import jdk.test.lib.jfr.Events;
38 import jdk.test.lib.jfr.SimpleEventHelper;
39
40 /*
41 * @test
42 * @summary Test setDestination with concurrent recordings
43 * @key jfr
44 * @library /test/lib
45 * @run main/othervm -Xlog:jfr=trace jdk.jfr.api.recording.destination.TestDestMultiple
46 */
47 public class TestDestMultiple {
48
49 public static void main(String[] args) throws Throwable {
50 Recording rA = new Recording();
51 Recording rB = new Recording();
52
53 Path destA = Paths.get(".", "recA.jfr");
54 Path destB = Paths.get(".", "recB.jfr");
55 rA.setDestination(destA);
56 rB.setDestination(destB);
57
58 // Enable event in one recording and disable in the other.
59 // Both recordings should still get the events, since we always
60 // get the "union" of all settings.
61 SimpleEventHelper.enable(rA, true);
62 SimpleEventHelper.enable(rB, false);
63
|
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.destination;
27
28 import java.nio.file.Files;
29 import java.nio.file.Path;
30 import java.nio.file.Paths;
31 import java.util.List;
32
33 import jdk.jfr.Recording;
34 import jdk.jfr.consumer.RecordedEvent;
35 import jdk.jfr.consumer.RecordingFile;
36 import jdk.test.lib.Asserts;
37 import jdk.test.lib.jfr.Events;
38 import jdk.test.lib.jfr.SimpleEventHelper;
39
40 /**
41 * @test
42 * @summary Test setDestination with concurrent recordings
43 * @key jfr
44 * @requires vm.hasJFR
45 * @library /test/lib
46 * @run main/othervm -Xlog:jfr=trace jdk.jfr.api.recording.destination.TestDestMultiple
47 */
48 public class TestDestMultiple {
49
50 public static void main(String[] args) throws Throwable {
51 Recording rA = new Recording();
52 Recording rB = new Recording();
53
54 Path destA = Paths.get(".", "recA.jfr");
55 Path destB = Paths.get(".", "recB.jfr");
56 rA.setDestination(destA);
57 rB.setDestination(destB);
58
59 // Enable event in one recording and disable in the other.
60 // Both recordings should still get the events, since we always
61 // get the "union" of all settings.
62 SimpleEventHelper.enable(rA, true);
63 SimpleEventHelper.enable(rB, false);
64
|