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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9, 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: