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

RecordedEvent#getThread returns null for ExecutionSample events

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Won't Fix
    • P4
    • None
    • None
    • hotspot
    • None
    • jfr

    Description

      The method RecordedEvent#getThread returns the thread that is related to the event. In the current implementation, the value of the property eventThread is returned by this method. But ExecutionSample and NativeMethodSample events don't have a value for this property, only a value for the sampledThread property. Therefore the RecordedEvent#getThread returns always null for these events, which is confusing. A better behaviour would be to check first the eventThread and then the sampledThread property before finally returning null if there really is no related thread property.

      This could arguably include the allocStatisticsThread for ThreadAllocationStatistics events too, as shown by https://github.com/openjdk/jmc/blob/master/core/org.openjdk.jmc.flightrecorder/src/main/java/org/openjdk/jmc/flightrecorder/parser/synthetic/SyntheticAttributeExtension.java#L101 which normalizes the different thread property names in JMC.

      Attachments

        Activity

          People

            jbechberger Johannes Bechberger
            jbechberger Johannes Bechberger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: