GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Implement new '--inverted' option to flip graphs vertically by simonis · Pull Request #1178 · async-profiler/async-profiler

Conversation

@simonis

@simonis simonis commented Mar 13, 2025

Copy link
Copy Markdown
Contributor

Description

AsyncProfiler currently supports two kind of graphs:

  • The default flame graphs which grow from bottom to top (because flames grow from bottom to top) and show the outermost frames (e.g. the main() function) at the bottom and the innermost, leaf frames at the top. They are created from stack traces which are merged starting from the outermost (e.g. main()) frames.
  • Icicle graphs which grow top-down (because icicles grow to-down) and are created from reverse stack traces, i.e. stack traces which are merged starting with the innermost, leaf frames.

Both kind of graphs can be flipped vertically with the Revert button which is located in the upper-left corner of the generated HTML page, when the graph is displayed.

But normal/reverse stack traces and icicle/flame graphs are orthogonal settings. Both kind of stack traces can be flipped vertically. Unfortunately, the vertical orientation can currently only be changed in the generated HTML page but the default orientation can not be set when the graphs are generated. It always defaults to a bottom-up, flame graph layout for normal stack traces and a top-down, icicle layout for reverse stack traces.

This PR introduces a new command line parameter --inverted which makes it possible to change the default vertical orientation for both kind of stack traces. The name of the parameter (i.e. inverted instead of inverse) is taken from Brendan Greg's original flamegraph.pl script which also provides this option.

The PR doesn't change the default behavior of AsyncProfiler. Normal stack traces are still rendered as bottom-up flame graphs and reverse stack traces are still rendered as top-down icicle, graphs. But both of these defaults can now be changed with the new --inverted=<true|false> command line option.

Related issues

See the discussion on #82 for a similar request.

Motivation and context

See Description section.

How has this been tested?

make test and manual testing of the new parameter for asprof, jfrconv and the agent use case.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@simonis
Implement new '--inverted' option to flip graphs vertically
90cdb86
apangin
apangin reviewed Mar 14, 2025
View reviewed changes
Comment thread docs/ConverterUsage.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread docs/ProfilerOptions.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/Arguments.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/FlameGraph.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

simonis added 2 commits March 15, 2025 09:42
@simonis
Remove the mandatory argument for the '--inverted' option and make it…
f7229d3
… a toggle switch
@simonis
Merge branch 'master' into inverted-option
333d10f
apangin
apangin reviewed Mar 15, 2025
View reviewed changes
Comment thread docs/ConverterUsage.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/converter/one/convert/FlameGraph.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/flameGraph.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/main/main.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

apangin and others added 3 commits March 15, 2025 17:14
@apangin
Typos
1f42aee
Signed-off-by: Andrei Pangin <[email protected]>
@simonis
Merge branch 'async-profiler:master' into inverted-option
29d5741
@simonis
Fixed typos, leftovers and prettified markdown changes
df96170
@apangin
apangin merged commit fe1bc66 into async-profiler:master Mar 16, 2025
@apangin

apangin commented Mar 16, 2025

Copy link
Copy Markdown
Collaborator

Merged. Thank you for the contribution!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@apangin apangin mentioned this pull request Mar 20, 2025
Fix typo in --inverted docs #1183
Merged
krk pushed a commit to krk/async-profiler that referenced this pull request Mar 24, 2025
@simonis @krk
Implement new '--inverted' option to flip graphs vertically (async-pr…
38a2835
…ofiler#1178)
@krk krk mentioned this pull request Sep 10, 2025
Reconvert outdated flamegraph.html #1472
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@apangin apangin apangin left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@simonis @apangin
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.