< prev index next >

test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.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.assertTrue;
  29 
  30 import java.util.ArrayList;
  31 import java.util.List;
  32 import java.util.stream.Collectors;
  33 
  34 import jdk.jfr.Recording;
  35 import jdk.jfr.consumer.RecordedEvent;
  36 import jdk.test.lib.Platform;
  37 import jdk.test.lib.jfr.EventNames;
  38 import jdk.test.lib.jfr.Events;
  39 
  40 /*
  41  * @test
  42  * @key jfr

  43  * @library /test/lib
  44  * @run main/othervm jdk.jfr.event.runtime.TestNativeLibrariesEvent
  45  */
  46 public class TestNativeLibrariesEvent {
  47 
  48     private final static String EVENT_NAME = EventNames.NativeLibrary;
  49 
  50     public static void main(String[] args) throws Throwable {
  51         Recording recording = new Recording();
  52         recording.enable(EVENT_NAME);
  53         recording.start();
  54         recording.stop();
  55 
  56         List<String> expectedLibs = getExpectedLibs();
  57         for (RecordedEvent event : Events.fromRecording(recording)) {
  58             System.out.println("Event:" + event);
  59             long unsignedTopAddress = event.getValue("topAddress");
  60             long unsignedBaseAddress = event.getValue("baseAddress");
  61             assertValidAddresses(unsignedBaseAddress, unsignedTopAddress);
  62             String lib = Events.assertField(event, "name").notEmpty().getValue();




  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.assertTrue;
  29 
  30 import java.util.ArrayList;
  31 import java.util.List;
  32 import java.util.stream.Collectors;
  33 
  34 import jdk.jfr.Recording;
  35 import jdk.jfr.consumer.RecordedEvent;
  36 import jdk.test.lib.Platform;
  37 import jdk.test.lib.jfr.EventNames;
  38 import jdk.test.lib.jfr.Events;
  39 
  40 /**
  41  * @test
  42  * @key jfr
  43  * @requires vm.hasJFR
  44  * @library /test/lib
  45  * @run main/othervm jdk.jfr.event.runtime.TestNativeLibrariesEvent
  46  */
  47 public class TestNativeLibrariesEvent {
  48 
  49     private final static String EVENT_NAME = EventNames.NativeLibrary;
  50 
  51     public static void main(String[] args) throws Throwable {
  52         Recording recording = new Recording();
  53         recording.enable(EVENT_NAME);
  54         recording.start();
  55         recording.stop();
  56 
  57         List<String> expectedLibs = getExpectedLibs();
  58         for (RecordedEvent event : Events.fromRecording(recording)) {
  59             System.out.println("Event:" + event);
  60             long unsignedTopAddress = event.getValue("topAddress");
  61             long unsignedBaseAddress = event.getValue("baseAddress");
  62             assertValidAddresses(unsignedBaseAddress, unsignedTopAddress);
  63             String lib = Events.assertField(event, "name").notEmpty().getValue();


< prev index next >