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

JFR: GC evacuation statistics struct contains gcId field

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3
    • tbd
    • None
    • hotspot
    • None
    • jfr

    Description

      There are two G1 evacuation statistics events, old and young, and they both have a statistics field.

      What is strange is that gcId is located in the statistics field. It should be in the event, like all other GC events. Otherwise, the fully qualified name of the field becomes "statistics.gcId" instead of "gcId".

        <Type name="G1EvacuationStatistics">
          <Field type="uint" name="gcId" ... />
          <Field type="ulong" contentType="bytes" name="allocated" ... />
          <Field type="ulong" contentType="bytes" name="wasted" ... />
          <Field type="ulong" contentType="bytes" name="used" ... />
          <Field type="ulong" contentType="bytes" name="undoWaste" ... />
          <Field type="ulong" contentType="bytes" name="regionEndWaste" ... />
          <Field type="uint" name="regionsRefilled" ... />
          <Field type="ulong" name="numPlabsFilled" ... />
          <Field type="ulong" contentType="bytes" name="directAllocated" ... />
          <Field type="ulong" name="numDirectAllocated" ... />
          <Field type="ulong" contentType="bytes" name="failureUsed" ... />
          <Field type="ulong" contentType="bytes" name="failureWaste" ... />
        </Type>

        <Event name="G1EvacuationYoungStatistics" ... >
          <Field type="G1EvacuationStatistics" struct="true" name="statistics" label="Evacuation Statistics" />
        </Event>

        <Event name="G1EvacuationOldStatistics" ... >
          <Field type="G1EvacuationStatistics" struct="true" name="statistics" label="Evacuation Statistics" />
        </Event>

      I understand the convenience of using the G1EvacuationStatistics struct in the JVM, but it would have been better to have all the field names at the top level. User who want to access the data in the API, now have to use event.getValue("statistics.used") instead of just event.getValue("used").

      Changing all the fields might be a too large change.

      To remain backward compatible with tooling we could consider keeping gcId in the struct but duplicate it in the event.


      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: