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

JFR: @StackFilter

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 22
    • 22
    • hotspot
    • None
    • jfr
    • b26

    Description

      When creating events today, the stack trace starts at the frame where the Event::commit() method was invoked. This doesn't work if there is a need to skip frames, for example if the event is committed in a utility method.

      Without the correct method as a top frame, it is harder to build proper visualization, for example a histogram grouped by the top frame.This problem has been known for a long time. It exists in the JDK, but also in third party libraries that uses the JFR event API.

      The proposal is to create an event annotation where users can specify the name of the methods from where the stack trace should begin, for example:

          @StackFilter("com.example.Foo::bar")
          public class ExampleEvent extends Event {
          }

      It would be possible to allow method parameters, but it complicates the design and the implementation, and could be added later, if there is a real need.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: