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

JFR: java.base events have incomplete stacktraces

    XMLWordPrintable

Details

    • jfr
    • b33
    • Not verified

    Backports

      Description

        JDK-8244661 modified the framework sligthly for how java.base events are written to the stream.

        The JVM.getStackTraceId() invocation used to look like this:

        Before (JDK14):

        [0] jdk.jfr.internal.JVM.getStackTraceId(I)J
        [1] jdk.jfr.internal.EventWriter.putStackTrace()V
        [2] jdk.jfr.internal.handlers.EventHandler1917_1595033287389-6404.write(JJLjava/lang/String;J)V
        [3] jdk.jfr.events.SocketWriteEvent.commit()V
        [4] java.net.Socket$SocketOutputStream.write([BII)V

        With JDK-8244661, it now looks like this:

        [0] jdk.jfr.internal.JVM.getStackTraceId(I)J
        [1] jdk.jfr.internal.EventWriter.putStackTrace()V
        [2] jdk.jfr.internal.handlers.EventHandler1917_1595033287389-6404.write(JJLjava/lang/String;J)V
        [3] java.net.Socket$SocketOutputStream.write([BII)V

        I.e, write() directly invokes EventHandler.write(), bypassing the invocation of SocketWriteEvent.commit().

        The parameter to JVM.getStackTraceId is an integer representing what is called a "skip level", i.e. how many frames should be skipped before the real stacktrace. The skip level is used to filter out frames related to the JFR framework, to let the user focus on the real trace.

        The current skip level is set to 4 (5 for Exception events), but this is now too big in relation to the modifications done in JDK-8244661, as it will also skip the first real frame.

        For events using the new handler mechanism, the skip level should be updated to 3 (and 4 for Exceptions events respectively) to align with the changes in JDK-8244661.

        Attachments

          1. fix.jpg
            fix.jpg
            277 kB
          2. incomplete.jpg
            incomplete.jpg
            258 kB

          Issue Links

            Activity

              People

                mgronlun Markus Grönlund
                mgronlun Markus Grönlund
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: