RFR: 7894: Provide an alternative Java based flamegraph visualization [v11]

Alex Macdonald aptmac at openjdk.org
Thu Jun 8 14:43:07 UTC 2023


On Thu, 8 Jun 2023 08:14:55 GMT, Brice Dutheil <bdutheil at openjdk.org> wrote:

>> This change introduces a possible replacement for the current flamegraph view.
>> 
>> **Motivation**
>> The current is based on a web view. In the current state, 
>> - the web view can be slow to render especially when the tree is large.
>> - the web view don't feel well integrated, in particular when popups are shown.
>> - web view are difficult to work with from a JMC developer perspective.
>> 
>> ![image](https://user-images.githubusercontent.com/803621/177537938-423a4d53-c2ac-4c56-8583-abe4cc910e37.png)
>> 
>> **Description**
>> Concretely this PR relies on the swing component to render flamegraphs : https://github.com/bric3/fireplace. And plays with the bridge between SWT and AWT via the `SWT_AWT` class.
>> 
>> As the intent of this view is to eventually replace the current one, the icons are the same.
>> 
>> Since fireplace has no actual release, only snapshots, in order to try this PR, it is necessary to install the snapshot manually before starting the p2 server.
>> 
>> 
>> cd releng/third-party
>> 
>> mvn dependency:get -DrepoUrl=https://s01.oss.sonatype.org/content/repositories/snapshots -Dartifact=io.github.bric3.fireplace:fireplace-swing:0.0.1-SNAPSHOT:jar
>> 
>> # if sources are wanted
>> mvn dependency:get -DrepoUrl=https://s01.oss.sonatype.org/content/repositories/snapshots -Dartifact=io.github.bric3.fireplace:fireplace-swing:0.0.1-SNAPSHOT:jar:sources
>> 
>> # make the p2 site, don't forget the -U
>> mvn p2:site -U; mvn jetty:run
>> 
>> 
>> **Outstanding issues / limitation**
>> - [x] Fireplace has not yet a stable release as some part of its API are a bit rough.
>> - [x] Currently the view does not initializes correctly:
>>    the swing `JScrollPane` don't show scroll bars, until the view is resized by the user. I lack the SWT / Swing expertise to understand why at this time.
>>    https://github.com/bric3/fireplace/issues/79
>> - [x] Fireplace only supports _icicle_ view at this time.
>>    https://github.com/bric3/fireplace/issues/22
>> - [x] Icons for minimap toggle and zoom reset
>>    <img width="237" alt="image" src="https://user-images.githubusercontent.com/803621/183126781-07af0e94-a5d5-458c-97e3-a5e012177248.png">
>> - [x] Export to image
>>    https://github.com/bric3/fireplace/issues/99
>> - [x] Export to print ?
>>    Can be done at a later time
>> - [x] release of fireplace
>
> Brice Dutheil has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix spotless issues

Minor nits, it looks like there's a couple instances of `JavaSE-11` that could be updated to 17, and the license headers will need to be updated to 2023.

The UI is snappy and it feels really nice to use. I'm not sure what's happened recently, but I feel like my swt browser has gotten slower with each eclipse release, this was a breath of fresh air.

I do have a couple of things to note here. 
- I'd have to take a bit more a look if it's just me, but I don't have any tooltips displayed when hovering the graph lanes.
- Maybe there's a way to distinguish this new flame view from the old one? When adding it to the view it might not be intuitive which one to pick, "Flame View vs. Flame Graph View"
- The save feature is saving an empty file for me
![empty-picture](https://github.com/openjdk/jmc/assets/10425301/a1576276-96f6-4d4f-91eb-ec6fe0cffbec)

I do have a couple questions about the fireplace dependency too.
- It looks like you've tagged a rc5 on your repo, should this PR be updated to include that latest version?
- What is the future for this dependency? Could it be hosted on something like maven central? Just thinking about potential vendor builds & releases of JMC and the validity pulling rc tags from GitHub.

application/org.openjdk.jmc.flightrecorder.flamegraph/.classpath line 5:

> 3: 	<classpathentry kind="src" path="src/main/java"/>
> 4: 	<classpathentry kind="src" path="src/main/resources"/>
> 5: 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>

With the recent updates I think this should be updated to: `JavaSE-17` ?

application/org.openjdk.jmc.flightrecorder.flamegraph/META-INF/MANIFEST.MF line 17:

> 15:  fireplace-swing-animation,
> 16:  radiance-animation
> 17: Bundle-RequiredExecutionEnvironment: JavaSE-11

Same as above, `JavaSE-17` ?

application/org.openjdk.jmc.flightrecorder.flamegraph/plugin.properties line 2:

> 1: #
> 2: #  Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.

Update the license headers to 2023

-------------

Changes requested by aptmac (Reviewer).

PR Review: https://git.openjdk.org/jmc/pull/408#pullrequestreview-1470014903
PR Review Comment: https://git.openjdk.org/jmc/pull/408#discussion_r1223105308
PR Review Comment: https://git.openjdk.org/jmc/pull/408#discussion_r1223106010
PR Review Comment: https://git.openjdk.org/jmc/pull/408#discussion_r1223106562


More information about the jmc-dev mailing list