< prev index next >

test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationInfoEvent.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.event.gc.detailed;
  27 
  28 import java.time.Duration;
  29 import java.util.List;
  30 import java.util.Optional;
  31 import java.util.Random;
  32 
  33 import jdk.jfr.Recording;
  34 import jdk.jfr.consumer.RecordedEvent;
  35 import jdk.test.lib.Asserts;
  36 import jdk.test.lib.jfr.EventNames;
  37 import jdk.test.lib.jfr.Events;
  38 
  39 /*
  40  * @test
  41  * @key jfr

  42  * @requires vm.gc == "G1" | vm.gc == null
  43  * @library /test/lib /test/jdk
  44  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:G1HeapRegionSize=1m -Xmx64m -Xmn16m -XX:+UseG1GC jdk.jfr.event.gc.detailed.TestEvacuationInfoEvent
  45  */
  46 public class TestEvacuationInfoEvent {
  47     private final static String EVENT_INFO_NAME = EventNames.EvacuationInfo;
  48     private final static String EVENT_FAILED_NAME = EventNames.EvacuationFailed;
  49 
  50     public static void main(String[] args) throws Throwable {
  51         final long g1HeapRegionSize = 1024 * 1024;
  52         Recording recording = new Recording();
  53         recording.enable(EVENT_INFO_NAME).withThreshold(Duration.ofMillis(0));
  54         recording.enable(EVENT_FAILED_NAME).withThreshold(Duration.ofMillis(0));
  55         recording.start();
  56         allocate();
  57         recording.stop();
  58 
  59         List<RecordedEvent> events = Events.fromRecording(recording);
  60         Asserts.assertFalse(events.isEmpty(), "No events found");
  61         for (RecordedEvent event : events) {




  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.event.gc.detailed;
  27 
  28 import java.time.Duration;
  29 import java.util.List;
  30 import java.util.Optional;
  31 import java.util.Random;
  32 
  33 import jdk.jfr.Recording;
  34 import jdk.jfr.consumer.RecordedEvent;
  35 import jdk.test.lib.Asserts;
  36 import jdk.test.lib.jfr.EventNames;
  37 import jdk.test.lib.jfr.Events;
  38 
  39 /**
  40  * @test
  41  * @key jfr
  42  * @requires vm.hasJFR
  43  * @requires vm.gc == "G1" | vm.gc == null
  44  * @library /test/lib /test/jdk
  45  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:G1HeapRegionSize=1m -Xmx64m -Xmn16m -XX:+UseG1GC jdk.jfr.event.gc.detailed.TestEvacuationInfoEvent
  46  */
  47 public class TestEvacuationInfoEvent {
  48     private final static String EVENT_INFO_NAME = EventNames.EvacuationInfo;
  49     private final static String EVENT_FAILED_NAME = EventNames.EvacuationFailed;
  50 
  51     public static void main(String[] args) throws Throwable {
  52         final long g1HeapRegionSize = 1024 * 1024;
  53         Recording recording = new Recording();
  54         recording.enable(EVENT_INFO_NAME).withThreshold(Duration.ofMillis(0));
  55         recording.enable(EVENT_FAILED_NAME).withThreshold(Duration.ofMillis(0));
  56         recording.start();
  57         allocate();
  58         recording.stop();
  59 
  60         List<RecordedEvent> events = Events.fromRecording(recording);
  61         Asserts.assertFalse(events.isEmpty(), "No events found");
  62         for (RecordedEvent event : events) {


< prev index next >