21 *
22 */
23
24 package jdk.jfr.event.gc.detailed;
25
26 import java.nio.file.Paths;
27 import java.util.List;
28
29 import jdk.jfr.EventType;
30 import jdk.jfr.FlightRecorder;
31 import jdk.jfr.Recording;
32 import jdk.jfr.consumer.RecordedEvent;
33 import jdk.test.lib.Asserts;
34 import jdk.test.lib.jfr.EventNames;
35 import jdk.test.lib.jfr.Events;
36 import jdk.test.lib.jfr.GCHelper;
37
38 /**
39 * @test
40 * @bug 8221507
41 * @requires vm.hasJFR
42 * @requires vm.gc == "Shenandoah" | vm.gc == null
43 * @key jfr
44 * @library /test/lib /test/jdk
45 * @run main/othervm -Xmx32m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGarbageThreshold=1 jdk.jfr.event.gc.detailed.TestShenandoahHeapRegionInformationEvent
46 */
47
48
49 public class TestShenandoahHeapRegionInformationEvent {
50 private final static String EVENT_NAME = EventNames.ShenandoahHeapRegionInformation;
51 public static void main(String[] args) throws Exception {
52 try (Recording recording = new Recording()) {
53 // activate the event we are interested in and start recording
54 for (EventType t : FlightRecorder.getFlightRecorder().getEventTypes()) {
55 System.out.println(t.getName());
56 }
57 recording.enable(EVENT_NAME);
58 recording.start();
59 recording.stop();
60
61 // Verify recording
62 List<RecordedEvent> events = Events.fromRecording(recording);
|
21 *
22 */
23
24 package jdk.jfr.event.gc.detailed;
25
26 import java.nio.file.Paths;
27 import java.util.List;
28
29 import jdk.jfr.EventType;
30 import jdk.jfr.FlightRecorder;
31 import jdk.jfr.Recording;
32 import jdk.jfr.consumer.RecordedEvent;
33 import jdk.test.lib.Asserts;
34 import jdk.test.lib.jfr.EventNames;
35 import jdk.test.lib.jfr.Events;
36 import jdk.test.lib.jfr.GCHelper;
37
38 /**
39 * @test
40 * @bug 8221507
41 * @requires vm.hasJFR & vm.gc.Shenandoah
42 * @key jfr
43 * @library /test/lib /test/jdk
44 * @run main/othervm -Xmx32m -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:ShenandoahGarbageThreshold=1 jdk.jfr.event.gc.detailed.TestShenandoahHeapRegionInformationEvent
45 */
46
47
48 public class TestShenandoahHeapRegionInformationEvent {
49 private final static String EVENT_NAME = EventNames.ShenandoahHeapRegionInformation;
50 public static void main(String[] args) throws Exception {
51 try (Recording recording = new Recording()) {
52 // activate the event we are interested in and start recording
53 for (EventType t : FlightRecorder.getFlightRecorder().getEventTypes()) {
54 System.out.println(t.getName());
55 }
56 recording.enable(EVENT_NAME);
57 recording.start();
58 recording.stop();
59
60 // Verify recording
61 List<RecordedEvent> events = Events.fromRecording(recording);
|