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

Generated JfrNativeSettings seems off

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 24
    • None
    • hotspot
    • jfr
    • b06

      The generated JfrNativeSettings union holds an array of settings ("bits") overlayed with named structures ("ev"). The latter only exists for debugging:

      ```
      union JfrNativeSettings {
        // Array version.
        jfrNativeEventSetting bits[NUMBER_OF_EVENTS];
        // Then, to make it easy to debug,
        // add named struct members also.
        struct {
          jfrNativeEventSetting pad[NUMBER_OF_RESERVED_EVENTS];
          jfrNativeEventSetting Duration;
          jfrNativeEventSetting Instant;
          jfrNativeEventSetting Value;
          jfrNativeEventSetting Text;
          jfrNativeEventSetting ZThreadDebug;
          ...
          jfrNativeEventSetting DeprecatedInvocation;
          jfrNativeEventSetting StackFrame;
        } ev;
      };

      ```

      I noticed that sizes of `bits` vs `ev` did not match up (even adding the fix Matthias proposed for JDK-8332699). Looks like the `ev` substructure contains members that are not events:

      ```
      jfrNativeEventSetting VirtualSpace;
      jfrNativeEventSetting ObjectSpace;
      ...
      jfrNativeEventSetting MetaspaceSizes;
      ...
      jfrNativeEventSetting CopyFailed;
      ...
      jfrNativeEventSetting G1EvacuationStatistics;
      ...
      jfrNativeEventSetting CalleeMethod;
      ...
      jfrNativeEventSetting StackFrame;
      ```

      These are types of fields, not events. Therefore, the overlayed named structures would not match up against their corresponding bits[event id] slot.

      The ev substructure is not used during building, so I assume one only notices during debugging.

      (error relates to, but is different from, the issue described in JDK-8332699)

            rtoyonaga Robert Toyonaga
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: