Description
Feature request
Is your feature request related to a problem? Please describe.
Currently, JFR stacktraces include all frames up to the point the stack walk is done.
This means that the last few frames in the stacktrace always display internal code and are probably not interesting to the user. This makes flamegraphs more cluttered than necessary and does not match the behavior of JFR in Java mode (shown below).
Describe the solution you'd like.
It might be useful if the stacktraces were trimmed for each event where stacktraces are enabled such that they are similar to the ones obtained running in Java mode. The infrastructure to do this is already in place so the work should be very minimal. Setting the stacktrace skipcount
from the point of event emission for each event should do the trick.
Describe who do you think will benefit the most.
JFR users.
Describe alternatives you've considered.
1). Continue collecting the full stacktrace. This might be useful for those developing GraalVM. Collecting the full stacktrace also avoids having to update a hard-coded skipcount
whenever the underlying JFR implementation changes (but this is probably a minor benefit).
2). Only trim the last ~3 frames that pertain to the actual stacktrace generation. Keep the other internal frames to assist with GraalVM development and debugging.
I think any of these options are reasonable, but that it's probably worth bringing up for discussion.
Express whether you'd like to help contributing this feature
I can do this, if we decide this change is desirable.