< prev index next >

test/jdk/jfr/event/compiler/TestCodeCacheConfig.java

Print this page
rev 13658 : 8229401: Fix JFR code cache test failures


  27 
  28 import java.util.List;
  29 
  30 import jdk.jfr.Recording;
  31 import jdk.jfr.consumer.RecordedEvent;
  32 import jdk.test.lib.Asserts;
  33 import jdk.test.lib.jfr.EventNames;
  34 import jdk.test.lib.jfr.Events;
  35 import sun.hotspot.WhiteBox;
  36 
  37 /**
  38  * @test TestCodeCacheConfig
  39  * @key jfr
  40  *
  41  * @library /lib /
  42  * @build sun.hotspot.WhiteBox
  43  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  44  *     sun.hotspot.WhiteBox$WhiteBoxPermission
  45  * @run main/othervm -Xbootclasspath/a:.
  46  *     -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  47  *     -XX:+SegmentedCodeCache jdk.jfr.event.compiler.TestCodeCacheConfig
  48  * @run main/othervm -Xbootclasspath/a:.
  49  *     -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  50  *     -XX:-SegmentedCodeCache jdk.jfr.event.compiler.TestCodeCacheConfig
  51  * @summary check "Code Cache Configuration" jfr event
  52  */
  53 public class TestCodeCacheConfig {
  54     private final static String EVENT_NAME = EventNames.CodeCacheConfiguration;
  55 
  56     private static final long CodeCacheExpectedSize = WhiteBox.getWhiteBox().getUintxVMFlag("ReservedCodeCacheSize");
  57 
  58     public static void main(String[] args) throws Exception {
  59         Recording recording = new Recording();
  60         recording.enable(EVENT_NAME);
  61         recording.start();
  62         recording.stop();
  63 
  64         List<RecordedEvent> events = Events.fromRecording(recording);
  65         Events.hasEvents(events);
  66         RecordedEvent event = events.get(0);
  67         long initialSize = (long) event.getValue("initialSize");
  68         long reservedSize = (long) event.getValue("reservedSize");
  69         long nonNMethodSize = (long) event.getValue("nonNMethodSize");
  70         long profiledSize = (long) event.getValue("profiledSize");




  27 
  28 import java.util.List;
  29 
  30 import jdk.jfr.Recording;
  31 import jdk.jfr.consumer.RecordedEvent;
  32 import jdk.test.lib.Asserts;
  33 import jdk.test.lib.jfr.EventNames;
  34 import jdk.test.lib.jfr.Events;
  35 import sun.hotspot.WhiteBox;
  36 
  37 /**
  38  * @test TestCodeCacheConfig
  39  * @key jfr
  40  *
  41  * @library /lib /
  42  * @build sun.hotspot.WhiteBox
  43  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  44  *     sun.hotspot.WhiteBox$WhiteBoxPermission
  45  * @run main/othervm -Xbootclasspath/a:.
  46  *     -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  47  *     jdk.jfr.event.compiler.TestCodeCacheConfig
  48  * @run main/othervm -Xbootclasspath/a:.
  49  *     -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  50  *     jdk.jfr.event.compiler.TestCodeCacheConfig
  51  * @summary check "Code Cache Configuration" jfr event
  52  */
  53 public class TestCodeCacheConfig {
  54     private final static String EVENT_NAME = EventNames.CodeCacheConfiguration;
  55 
  56     private static final long CodeCacheExpectedSize = WhiteBox.getWhiteBox().getUintxVMFlag("ReservedCodeCacheSize");
  57 
  58     public static void main(String[] args) throws Exception {
  59         Recording recording = new Recording();
  60         recording.enable(EVENT_NAME);
  61         recording.start();
  62         recording.stop();
  63 
  64         List<RecordedEvent> events = Events.fromRecording(recording);
  65         Events.hasEvents(events);
  66         RecordedEvent event = events.get(0);
  67         long initialSize = (long) event.getValue("initialSize");
  68         long reservedSize = (long) event.getValue("reservedSize");
  69         long nonNMethodSize = (long) event.getValue("nonNMethodSize");
  70         long profiledSize = (long) event.getValue("profiledSize");


< prev index next >