< prev index next >

test/jdk/jdk/jfr/api/flightrecorder/TestAddPeriodicEvent.java

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


  18  * 2 along with this work; if not, write to the Free Software Foundation,
  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.api.flightrecorder;
  27 
  28 import static jdk.test.lib.Asserts.assertFalse;
  29 import static jdk.test.lib.Asserts.assertTrue;
  30 
  31 import java.time.Duration;
  32 import java.util.concurrent.CountDownLatch;
  33 
  34 import jdk.jfr.Event;
  35 import jdk.jfr.FlightRecorder;
  36 import jdk.jfr.Recording;
  37 
  38 /*
  39  * @test
  40  * @summary
  41  * @key jfr

  42  * @library /test/lib
  43  * @run main/othervm jdk.jfr.api.flightrecorder.TestAddPeriodicEvent
  44  */
  45 public class TestAddPeriodicEvent {
  46 
  47     private static class MyEvent extends Event {
  48 
  49     }
  50 
  51     CountDownLatch latch = new CountDownLatch(3);
  52 
  53     class MyHook implements Runnable {
  54 
  55         private int eventCounter;
  56         private long previousTime;
  57 
  58         @Override
  59         public void run() {
  60             log("Commiting event " + (++eventCounter));
  61             if (previousTime == 0) {




  18  * 2 along with this work; if not, write to the Free Software Foundation,
  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.api.flightrecorder;
  27 
  28 import static jdk.test.lib.Asserts.assertFalse;
  29 import static jdk.test.lib.Asserts.assertTrue;
  30 
  31 import java.time.Duration;
  32 import java.util.concurrent.CountDownLatch;
  33 
  34 import jdk.jfr.Event;
  35 import jdk.jfr.FlightRecorder;
  36 import jdk.jfr.Recording;
  37 
  38 /**
  39  * @test
  40  * @summary
  41  * @key jfr
  42  * @requires vm.hasJFR
  43  * @library /test/lib
  44  * @run main/othervm jdk.jfr.api.flightrecorder.TestAddPeriodicEvent
  45  */
  46 public class TestAddPeriodicEvent {
  47 
  48     private static class MyEvent extends Event {
  49 
  50     }
  51 
  52     CountDownLatch latch = new CountDownLatch(3);
  53 
  54     class MyHook implements Runnable {
  55 
  56         private int eventCounter;
  57         private long previousTime;
  58 
  59         @Override
  60         public void run() {
  61             log("Commiting event " + (++eventCounter));
  62             if (previousTime == 0) {


< prev index next >