Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8339954: Print JVMCI names with the Compiler.{perfmap,codelist,CodeHeap_Analytics} diagnostic commands #20954

Closed
wants to merge 2 commits into from

Conversation

simonis
Copy link
Member

@simonis simonis commented Sep 11, 2024

The diagnostic commands Compiler.codelist, Compiler.CodeHeap_Analytics and Compiler.perfmap are handy for analyzing the CodeCache or creating a symbol file for the perf tool. However, with the Truffle framework which uses the GraalVM compiler in "hosted" mode, we can end up with hundreds if not thousands of nmethods which are all linked to the same Java method (most prominently com.oracle.truffle.runtime.OptimizedCallTarget.profiledPERoot()). All these nmethods are currently indistinguishable by the two aforementioned diagnostic commands.

But nmethods compiled by the GraalVM compiler have a special "JVMCI name" attached to them, which in the case of Truffle corresponds to the guest language function name. Printing this "JVMCI name" in addition to the true Java method name makes it easier to distinguish various nmethods compiled by Truffle or other frameworks which use the GraalVM compiler in hosted mode.

For the Compiler.perfmap command, it should be mentioned that the format of the created perfmap file is specified here:
https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/jit-interface.txt

It only mandates that each line starts with a start and size number in hex and interprets the whole rest of the line (which can even include special characters) as a "symbolname". Taking into account that we already today produce "symbol names" as different as "throw_range_check_failed Runtime1 stub", "Signature Handler Temp Buffer", "I2C/C2I adapters" or "boolean java.lang.invoke.VarHandleInts$FieldInstanceReadWrite.compareAndSet(java.lang.invoke.VarHandle, java.lang.Object, int, int)", adding a potential jvmci suffix like "jvmci_name=myFancyJSFunction()#2" to some methods will not cause any compatibility issues.

..and the output of Compiler.CodeHeap_Analytics is unparsable anyway :)


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8339954: Print JVMCI names with the Compiler.{perfmap,codelist,CodeHeap_Analytics} diagnostic commands (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/20954/head:pull/20954
$ git checkout pull/20954

Update a local copy of the PR:
$ git checkout pull/20954
$ git pull https://git.openjdk.org/jdk.git pull/20954/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20954

View PR using the GUI difftool:
$ git pr show -t 20954

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/20954.diff

Webrev

Link to Webrev Comment

Sorry, something went wrong.

…p_Analytics} diagnostic commands
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 11, 2024

👋 Welcome back simonis! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 11, 2024

@simonis This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8339954: Print JVMCI names with the Compiler.{perfmap,codelist,CodeHeap_Analytics} diagnostic commands

Reviewed-by: phh, dnsimon

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 47 new commits pushed to the master branch:

  • 5459518: 8339627: Cleanup Unsafe.setMemory intrinsic code
  • a4eb9a0: 8339918: Remove checks for outdated -t -tm -Xfuture -checksource -cs -noasyncgc options from the launcher
  • 6be15c3: 8340012: [C2] assert(KlassEncodingMetaspaceMax > pd) failed: change encoding max if new encoding after 8338526
  • 4b79063: 8339842: Open source several AWT focus tests - series 2
  • dc00eb8: 8338912: CDS: Segmented roots array
  • 74add0e: 8340105: Expose BitMap::print_on in release builds
  • 0e0f10f: 8340102: Move assert-only loop in OopMapSort::sort under debug macro
  • a0794e0: 8339639: Opensource few AWT PopupMenu tests
  • a8f143c: 8306679: com/sun/jdi/InterruptHangTest.java asserts with -Xcomp -Dmain.wrapper=Virtual options
  • c91fa27: 8339725: Concurrent GC crashed due to GetMethodDeclaringClass
  • ... and 37 more: https://git.openjdk.org/jdk/compare/d9fdf69c34c20e0f2d526c2f04450acb904c3e80...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 11, 2024
@openjdk
Copy link

openjdk bot commented Sep 11, 2024

@simonis The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Sep 11, 2024
@mlbridge
Copy link

mlbridge bot commented Sep 11, 2024

Webrevs

Copy link
Member

@phohensee phohensee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this. Lgtm.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 12, 2024
@simonis simonis changed the title 8339954: Print JVMCI names with the Compiler.{permap,codelist,CodeHeap_Analytics} diagnostic commands 8339954: Print JVMCI names with the Compiler.{perfmap,codelist,CodeHeap_Analytics} diagnostic commands Sep 12, 2024
@openjdk openjdk bot added ready Pull request is ready to be integrated and removed ready Pull request is ready to be integrated labels Sep 12, 2024
Copy link
Member

@dougxc dougxc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me.

@simonis
Copy link
Member Author

simonis commented Sep 16, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Sep 16, 2024

Going to push as commit 996790c.
Since your change was applied there have been 49 commits pushed to the master branch:

  • e1ebeef: 8340131: Refactor internal makeHiddenClassDefiner to take option mask instead of Set
  • 05b9d47: 8340194: Replace usage of -ms with -Xms in LauncherCommon.gmk make file
  • 5459518: 8339627: Cleanup Unsafe.setMemory intrinsic code
  • a4eb9a0: 8339918: Remove checks for outdated -t -tm -Xfuture -checksource -cs -noasyncgc options from the launcher
  • 6be15c3: 8340012: [C2] assert(KlassEncodingMetaspaceMax > pd) failed: change encoding max if new encoding after 8338526
  • 4b79063: 8339842: Open source several AWT focus tests - series 2
  • dc00eb8: 8338912: CDS: Segmented roots array
  • 74add0e: 8340105: Expose BitMap::print_on in release builds
  • 0e0f10f: 8340102: Move assert-only loop in OopMapSort::sort under debug macro
  • a0794e0: 8339639: Opensource few AWT PopupMenu tests
  • ... and 39 more: https://git.openjdk.org/jdk/compare/d9fdf69c34c20e0f2d526c2f04450acb904c3e80...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Sep 16, 2024
@openjdk openjdk bot closed this Sep 16, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 16, 2024
@openjdk
Copy link

openjdk bot commented Sep 16, 2024

@simonis Pushed as commit 996790c.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

None yet

3 participants