RFR: 7894: Provide an alternative Java based flamegraph visualization

Marcus Hirt hirt at openjdk.org
Tue Sep 27 13:20:17 UTC 2022


On Wed, 6 Jul 2022 11:36:47 GMT, Brice Dutheil <duke 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

Changes requested by hirt (Lead).

application/org.openjdk.jmc.flightrecorder.flameview-java/plugin.properties line 2:

> 1: #
> 2: #  Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

application/org.openjdk.jmc.flightrecorder.flameview-java/plugin.xml line 3:

> 1: <?xml version="1.0" encoding="UTF-8"?>
> 2: <!--
> 3:    Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

application/org.openjdk.jmc.flightrecorder.flameview-java/pom.xml line 3:

> 1: <?xml version="1.0" encoding="UTF-8"?>
> 2: <!--
> 3:    Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

application/org.openjdk.jmc.flightrecorder.flameview-java/src/main/java/org/openjdk/jmc/flightrecorder/flameviewjava/FlameviewImages.java line 2:

> 1: /*
> 2:  * Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

application/org.openjdk.jmc.flightrecorder.flameview-java/src/main/java/org/openjdk/jmc/flightrecorder/flameviewjava/Messages.java line 2:

> 1: /*
> 2:  * Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

application/org.openjdk.jmc.flightrecorder.flameview-java/src/main/java/org/openjdk/jmc/flightrecorder/flameviewjava/MessagesUtils.java line 2:

> 1: /*
> 2:  * Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

application/org.openjdk.jmc.flightrecorder.flameview-java/src/main/java/org/openjdk/jmc/flightrecorder/flameviewjava/views/StyledToolTip.java line 2:

> 1: /*
> 2:  * Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

application/org.openjdk.jmc.flightrecorder.flameview-java/src/main/resources/org/openjdk/jmc/flightrecorder/flameviewjava/messages.properties line 2:

> 1: #
> 2: #  Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

application/org.openjdk.jmc.flightrecorder.flameview-java/src/main/resources/org/openjdk/jmc/flightrecorder/flameviewjava/messages_ja.properties line 2:

> 1: #
> 2: #  Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

application/org.openjdk.jmc.flightrecorder.flameview-java/src/main/resources/org/openjdk/jmc/flightrecorder/flameviewjava/messages_zh_CN.properties line 2:

> 1: #
> 2: #  Copyright (c) 2022, Datadog, Inc. All rights reserved.

Needs to be an Oracle/Datadog dual copyright. Check other Datadog provided files for examples.

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

PR: https://git.openjdk.org/jmc/pull/408


More information about the jmc-dev mailing list