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

JFR: User-defined events and settings with a one-letter name cannot be configured

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 26
    • 11, 17, 21, 25
    • hotspot
    • jfr
    • b10

      REPRODUCER:

      import java.nio.file.Path;
      import java.time.Duration;

      import jdk.jfr.*;
      import jdk.jfr.consumer.*;

      public class WAT {

          @Name("F")
          @StackTrace(false)
          static class A extends Event {
          }

          @Name("FF")
          @StackTrace(false)
          static class B extends Event {
          }

          public static void main(String... args) throws Exception {
              try (Recording r = new Recording()) {
                  r.enable("F").withStackTrace();
                  r.enable("FF").withStackTrace();
                  r.start();
                  A a = new A();
                  a.commit();
                  B b = new B();
                  b.commit();
                  r.stop();
                  Path p = Path.of("wat.jfr");
                  r.dump(p);
                  for (RecordedEvent e : RecordingFile.readAllEvents(p)) {
                      System.out.println(e);
                  }
              }
          }
      }
      OUTPUT:

      F {
        startTime = 10:40:54.209
        eventThread = "main" (javaThreadId = 1)
      }


      FF {
        startTime = 10:40:54.213
        eventThread = "main" (javaThreadId = 1)
        stackTrace = [
          WAT.main(String[]) line: 28
          jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Method, Object, Object[])
          jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62
          jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43
          java.lang.reflect.Method.invoke(Object, Object[]) line: 566
          ...
        ]
      }

      The problem is a one-off error in the SettingsManager.

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

              Created:
              Updated:
              Resolved: