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

JFR: RemoteRecordingStream withers don't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2 P2
    • 26
    • 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
    • hotspot
    • None
    • jfr
    • Fix Understood

      Local recordings work fine:

          try (RecordingStream stream = new RecordingStream()) {
            stream.enable("jdk.CPULoad").withPeriod(ofSeconds(1));
            setEventHandlerAndStartAsyncRecording(stream);
          }

      Recording.RecordingSettings append the prefix
      https://github.com/openjdk/jdk/blob/b7703f7948039526cb7ca74ed589d6e3a876b6f6/src/jdk.jfr/share/classes/jdk/jfr/Recording.java#L75

      RemoteRecording works only when the key is constructed manually:

          try (var stream = new RemoteRecordingStream(mBeanServerConnection)) {
            stream.enable("jdk.CPULoad").with("jdk.CPULoad" + "#period", "1000ms");
            setEventHandlerAndStartAsyncRecording(stream);
          }

      Otherwise things like .withPeriod() don't work.

      with() doesn't do prefixing

      https://github.com/openjdk/jdk/blob/b7703f7948039526cb7ca74ed589d6e3a876b6f6/src/jdk.management.jfr/share/classes/jdk/management/jfr/RemoteRecordingStream.java#L108

      but enable()/disable() perform some prefixing to call with():

      https://github.com/openjdk/jdk/blob/b7703f7948039526cb7ca74ed589d6e3a876b6f6/src/jdk.management.jfr/share/classes/jdk/management/jfr/RemoteRecordingStream.java#L345

      https://github.com/openjdk/jdk/blob/b7703f7948039526cb7ca74ed589d6e3a876b6f6/src/jdk.management.jfr/share/classes/jdk/management/jfr/RemoteRecordingStream.java#L369

            egahlin Erik Gahlin
            dchuyko Dmitry Chuyko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: