< prev index next >

test/jdk/jdk/jfr/event/runtime/TestVmFlagChangedEvent.java

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


  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.runtime;
  27 
  28 import static jdk.test.lib.Asserts.assertEquals;
  29 import static jdk.test.lib.Asserts.assertTrue;
  30 
  31 import java.lang.management.ManagementFactory;
  32 
  33 import com.sun.management.HotSpotDiagnosticMXBean;
  34 
  35 import jdk.jfr.Recording;
  36 import jdk.jfr.consumer.RecordedEvent;
  37 import jdk.test.lib.jfr.EventNames;
  38 import jdk.test.lib.jfr.Events;
  39 
  40 /*
  41  * @test TestVmFlagChangedEvent
  42  * @key jfr

  43  * @library /test/lib
  44  * @modules jdk.jfr
  45  *          jdk.management
  46  *
  47  * @run main/othervm jdk.jfr.event.runtime.TestVmFlagChangedEvent
  48  */
  49 public final class TestVmFlagChangedEvent {
  50 
  51     public static void main(String[] args) throws Throwable {
  52         EventFlag[] eventFlags = {
  53             new EventFlag(EventNames.LongFlagChanged, "CMSWaitDuration", "2500"),
  54             new EventFlag(EventNames.StringFlagChanged, "HeapDumpPath", "/a/sample/path"),
  55             new EventFlag(EventNames.BooleanFlagChanged, "HeapDumpOnOutOfMemoryError", "true")
  56         };
  57 
  58         Recording recording = new Recording();
  59         for (EventFlag eventFlag : eventFlags) {
  60             recording.enable(eventFlag.eventName);
  61         }
  62 




  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.runtime;
  27 
  28 import static jdk.test.lib.Asserts.assertEquals;
  29 import static jdk.test.lib.Asserts.assertTrue;
  30 
  31 import java.lang.management.ManagementFactory;
  32 
  33 import com.sun.management.HotSpotDiagnosticMXBean;
  34 
  35 import jdk.jfr.Recording;
  36 import jdk.jfr.consumer.RecordedEvent;
  37 import jdk.test.lib.jfr.EventNames;
  38 import jdk.test.lib.jfr.Events;
  39 
  40 /**
  41  * @test TestVmFlagChangedEvent
  42  * @key jfr
  43  * @requires vm.hasJFR
  44  * @library /test/lib
  45  * @modules jdk.jfr
  46  *          jdk.management
  47  *
  48  * @run main/othervm jdk.jfr.event.runtime.TestVmFlagChangedEvent
  49  */
  50 public final class TestVmFlagChangedEvent {
  51 
  52     public static void main(String[] args) throws Throwable {
  53         EventFlag[] eventFlags = {
  54             new EventFlag(EventNames.LongFlagChanged, "CMSWaitDuration", "2500"),
  55             new EventFlag(EventNames.StringFlagChanged, "HeapDumpPath", "/a/sample/path"),
  56             new EventFlag(EventNames.BooleanFlagChanged, "HeapDumpOnOutOfMemoryError", "true")
  57         };
  58 
  59         Recording recording = new Recording();
  60         for (EventFlag eventFlag : eventFlags) {
  61             recording.enable(eventFlag.eventName);
  62         }
  63 


< prev index next >