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

JFR: Log warnings properly when loading a misconfigured .jfc file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 19
    • 17
    • hotspot
    • None
    • jfr
    • b05

      The control attribute in the setting element in a .jfc file may refer to a control element, for example, "jdk.FileRead#threshold" is controlled by "file-threshold".

          <event "jdk.FileRead>
            <setting name="threshold" control="file-threshold">20 ms</setting>
            ...
          </event>

          <text name="file-threshold" label="File I/O Threshold">20 ms</text>

      If a user has created a broken .jfc, by removing the control element, i.e <text>, without removing the corresponding control attributes, i.e control="file-threshold", a warning is issued.

      Problem is that the output is System.out.

      This works well when using 'jfr configure' command, but not when the model is parsed and validated by -XX:StartFlightRecorder or jcmd <pid> JFR.start. The warning should be printed to unified logging or the output of the diagnostic command.

      Consider backporting this to JDK 17, since the warning output could interfere with the output of the application, when starting JFR from command line or jcmd using a broken .jfc file. I have seen users create such broken .jfc files in the past.

      I: High, may disrupt application where standard out is piped. Red face
      L: Low, only happens with JFR and with user-edited .jfc. files
      W: Medium, remove broken parts of .jfc file

      ILW => HLM => P3

            egahlin Erik Gahlin
            egahlin Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: