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.
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
- csr for
-
JDK-8315236 JFR: @StackFilter
- Closed
- relates to
-
JDK-8330064 JFR: Incorrect function declarations for register/unregister_stack_filter
- Resolved
-
JDK-8322057 Memory leaks in creating jfr symbol array
- Resolved