RFR: 7806: Add an export option for Stacktraces in collapsed format

Marcus Hirt hirt at openjdk.org
Thu Oct 26 10:06:13 UTC 2023


On Fri, 8 Jul 2022 13:56:33 GMT, Jean-Philippe Bempel <jpbempel at openjdk.org> wrote:

> Add a new context menu when clicking on stacktrace view to export
> selected stacktraces as collapsed format. With this format it's
> easy to manipulate/filter stacktraces as text file and generate
> a flamegraph with the perl script from the flamegraph repository
> (https://github.com/brendangregg/FlameGraph)
> 
> The generated content is copied into the clipboard.
> 
> <img width="936" alt="Screenshot 2022-07-08 at 15 49 18" src="https://user-images.githubusercontent.com/4610701/178006101-f3ffba80-6332-4673-bc8e-299321bd6979.png">

Changes requested by hirt (Lead).

Hi @jpbempel! This is still a draft PR. Is there something that you'd like to do before marking it ready for review?

application/org.openjdk.jmc.flightrecorder.ui/src/main/java/org/openjdk/jmc/flightrecorder/ui/views/stacktrace/StacktraceView.java line 713:

> 711: 		memento.putBoolean(THREAD_ROOT_KEY, threadRootAtTop);
> 712: 		memento.putBoolean(TREE_LAYOUT_KEY, treeLayout);
> 713: 		memento.putBoolean(PERCENTAGE_DURATION_KEY, perDuration);

Update copyright year.

core/org.openjdk.jmc.flightrecorder.serializers/src/main/java/org/openjdk/jmc/flightrecorder/serializers/stacktraces/CollapsedSerializer.java line 12:

> 10: /**
> 11:  * Converts a {@link StacktraceTreeModel} to a collapsed format that can be used
> 12:  * as input for the flamegraph perl script from https://github.com/brendangregg/FlameGraph

Nit: End class comments with full stop.

core/org.openjdk.jmc.flightrecorder.serializers/src/main/java/org/openjdk/jmc/flightrecorder/serializers/stacktraces/CollapsedSerializer.java line 34:

> 32: 			appendFrame(sb, node.getFrame(), node.getCumulativeWeight());
> 33: 		}
> 34: 		if (node.getChildren().isEmpty()) {

Add copyright header.

core/org.openjdk.jmc.flightrecorder.serializers/src/main/java/org/openjdk/jmc/flightrecorder/serializers/stacktraces/CollapsedSerializer.java line 50:

> 48: 	}
> 49: 
> 50: 	public static void main(String[] args) {

Probably residual code from testing? Can be removed.

core/tests/org.openjdk.jmc.flightrecorder.serializers.test/src/main/java/org/openjdk/jmc/flightrecorder/serializers/stacktraces/test/CollapsedSerializerTest.java line 34:

> 32: 			false);
> 33: 
> 34: 	private static IItemCollection testRecording;

Copyright header.

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

PR Review: https://git.openjdk.org/jmc/pull/409#pullrequestreview-1060139142
PR Comment: https://git.openjdk.org/jmc/pull/409#issuecomment-1247087086
PR Review Comment: https://git.openjdk.org/jmc/pull/409#discussion_r936551667
PR Review Comment: https://git.openjdk.org/jmc/pull/409#discussion_r936553068
PR Review Comment: https://git.openjdk.org/jmc/pull/409#discussion_r936552163
PR Review Comment: https://git.openjdk.org/jmc/pull/409#discussion_r936553748
PR Review Comment: https://git.openjdk.org/jmc/pull/409#discussion_r936554037


More information about the jmc-dev mailing list