RFR: 6787: Simplified stack trace tree model [v8]
Alex Ciminian
github.com+348973+cimi at openjdk.java.net
Mon Nov 30 19:04:54 UTC 2020
On Mon, 30 Nov 2020 13:54:39 GMT, Marcus Hirt <hirt at openjdk.org> wrote:
>> Changes requested by hirt (Lead).
>
> I'm getting some differences:
> <img width="2267" alt="image" src="https://user-images.githubusercontent.com/16906077/100618156-bb091400-331b-11eb-9973-27a5a554c23c.png">
> 
Good catch and thanks for providing the example!
The difference between the two is `~ UNCLASSIFIABLE ~` frames showing up inside the flamegraph in the new version compared to the original where they don't.
The stacks match up in both, it's just that some frames are being replaced with the sentinel value because they have `IMCFrame.Type.UNKNOWN`. The check for truncated stacks in the tree model version is different from the original since `AggregatableFrame` doesn't expose the internal `IMCFrame` so can't directly check `frame == UNKNOWN_FRAME`.
(Disclaimer: I eyeballed this, I didn't revert to the version prior to me cleaning up the code where I could actually test the outputs, but I think the above is correct).
I made a fix that seems to work: besides the type, I now also check the frame name we would display and if that's equal to `.()` (what I noticed to be the name when we don't use `~ UNCLASSIFIABLE ~`) then we're looking at a truncated stack. So now we have this:
if (frame.getType().equals(IMCFrame.Type.UNKNOWN) && frame.getHumanReadableShortString().equals(".()")) {
Please tell me if there's a better way to do this Another idea I had was to create sentinel AggregatableFrames and check against those, but that felt more complicated than just adding this extra condition.
-------------
PR: https://git.openjdk.java.net/jmc/pull/159
More information about the jmc-dev
mailing list