< prev index next >

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

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


  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.time.Instant;
  29 import java.util.ArrayList;
  30 import java.util.Collections;
  31 import java.util.List;
  32 
  33 import jdk.jfr.Event;
  34 import jdk.jfr.Recording;
  35 import jdk.jfr.consumer.RecordedEvent;
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.jfr.CommonHelper;
  38 import jdk.test.lib.jfr.EventNames;
  39 import jdk.test.lib.jfr.Events;
  40 
  41 /*
  42  * @test
  43  * @summary Test getStartTime() and getEndTime(). Verify startTime <= endTime
  44  * @key jfr

  45  * @library /test/lib
  46  * @run main/othervm jdk.jfr.api.recording.event.TestEventTime
  47  */
  48 public class TestEventTime {
  49 
  50     static List<TimeEvent> actualOrder = new ArrayList<>();
  51 
  52     public static void main(String[] args) throws Throwable {
  53         Recording r = new Recording();
  54         r.enable(MyEvent.class).withoutStackTrace();
  55         // for debugging time related issues
  56         r.enable(EventNames.CPUTimeStampCounter);
  57         r.start();
  58         MyEvent event1 = beginEvent(1);
  59         MyEvent event2 = beginEvent(2);
  60         endEvent(event1);
  61         MyEvent event3 = beginEvent(3);
  62         endEvent(event2);
  63         endEvent(event3);
  64 




  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.time.Instant;
  29 import java.util.ArrayList;
  30 import java.util.Collections;
  31 import java.util.List;
  32 
  33 import jdk.jfr.Event;
  34 import jdk.jfr.Recording;
  35 import jdk.jfr.consumer.RecordedEvent;
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.jfr.CommonHelper;
  38 import jdk.test.lib.jfr.EventNames;
  39 import jdk.test.lib.jfr.Events;
  40 
  41 /**
  42  * @test
  43  * @summary Test getStartTime() and getEndTime(). Verify startTime <= endTime
  44  * @key jfr
  45  * @requires vm.hasJFR
  46  * @library /test/lib
  47  * @run main/othervm jdk.jfr.api.recording.event.TestEventTime
  48  */
  49 public class TestEventTime {
  50 
  51     static List<TimeEvent> actualOrder = new ArrayList<>();
  52 
  53     public static void main(String[] args) throws Throwable {
  54         Recording r = new Recording();
  55         r.enable(MyEvent.class).withoutStackTrace();
  56         // for debugging time related issues
  57         r.enable(EventNames.CPUTimeStampCounter);
  58         r.start();
  59         MyEvent event1 = beginEvent(1);
  60         MyEvent event2 = beginEvent(2);
  61         endEvent(event1);
  62         MyEvent event3 = beginEvent(3);
  63         endEvent(event2);
  64         endEvent(event3);
  65 


< prev index next >