Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8190191

Subclasses of jdk.jfr.Event loaded from CDS archive does not work with -XX:FlightRecorderOptions=retransform=false

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 10
    • 9, 10
    • hotspot
    • b33

    Description

      If a subclass of jdk.jfr.Event is loaded from the CDS archive, before JFR is initialized, this type of events does not function properly. Here's a skeletal example:

      java .... -XX:FlightRecorderOptions=retransform=false ... MyTest

      ------

      import jdk.jfr.Event;
      import jdk.jfr.EventType;

      class TestEvent extends Event { }
      class MyTest {
          public static void main(String args[]) throws Exception {
              // TestEvent class is loaded *from CDS archive*
              // before recording has started.
              EventType type = EventType.getEventType(TestEvent.class);

              // Start recording
              Recording r = new Recording();

              TestEvent testEvent = new TestEvent();
              testEvent.commit();
              r.stop()

              // At this point, the TestEvent is properly stored in "r" because the
              // testEvent.commit() method was not properly instrumented.

      Attachments

        Activity

          People

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: