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

Missing newline in the printout of certain JFR events

    XMLWordPrintable

Details

    • jfr
    • b21
    • generic
    • generic

    Description

      A DESCRIPTION OF THE PROBLEM :
      PrettyWriter::printClassLoader doesn't add a newline if the classloader is null, this causes the jfr CLI tool and also jdk.jfr.Event::toString() to print certain events slightly less pretty.

      but no fear, PR248 is here: https://github.com/openjdk/jdk/pull/248

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      how to reproduce using JFR CLI:
      To generate a JFR dump for testing, simply start HelloWorld.java

      public class HelloWorld {
          public static void main(String[] args) {System.out.println("hello there");}
      }

      with
      jdk-15+36/bin/java -XX:StartFlightRecording=filename=dump.jfr,dumponexit=true HelloWorld.java

      now inspect the dump with
      jfr print --events jdk.ModuleRequire dump.jfr

      and scroll or grep to an event with "classLoader = null"

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      (PR248 applied to JDK16)
      jdk16/build/linux-x86_64-server-release/jdk/bin/jfr print --events jdk.ModuleRequire dump.jfr
      ...
      jdk.ModuleRequire {
        startTime = 16:12:43.524
        source = {
          name = "jdk.nio.mapmode"
          version = "15"
          location = "jrt:/jdk.nio.mapmode"
          classLoader = null
        }
        requiredModule = {
          name = "java.base"
          version = "15"
          location = "jrt:/java.base"
          classLoader = null
        }
      }
      ...
      ACTUAL -
      (current result)
      jdk-15+36/bin/jfr print --events jdk.ModuleRequire dump.jfr
      ...
      jdk.ModuleRequire {
        startTime = 16:12:43.524
        source = {
          name = "jdk.nio.mapmode"
          version = "15"
          location = "jrt:/jdk.nio.mapmode"
          classLoader = null }
        requiredModule = {
          name = "java.base"
          version = "15"
          location = "jrt:/java.base"
          classLoader = null }
      }
      ...

      FREQUENCY : always


      Attachments

        1. dump.jfr
          248 kB
          swati sharma

        Issue Links

          Activity

            People

              mgronlun Markus Grönlund
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: