Skip to content

Conversation

@JohnTortugo
Copy link
Contributor

@JohnTortugo JohnTortugo commented Jan 23, 2025

Currently, -XX:+PrintCompilation does not print "hosted" JVMCI compilations (i.e. JVMCI compilations not triggered by the CompilerBroker but e.g. by the Truffle framework). On the other hand, if such an nmethod which results from a "hosted" compilation gets deoptimized, it will be printed by -XX:+PrintCompilation (with a compilation ID that doesn't appear anywhere before in the compilation log.

This pull request is intended to fix that. The snippet below is an example of output printed (with PrintCompilation and CIPrintCompilerName enabled) for Truffle hosted compilations using this patch.

783 JVMCI:4667       4       com.oracle.truffle.runtime.OptimizedCallTarget::callBoundary (19 bytes)   (hosted JVMCI compilation)
785 JVMCI:5342       4       com.oracle.truffle.runtime.hotspot.HotSpotFastThreadLocal::get (4 bytes)   (hosted JVMCI compilation)
786 JVMCI:5411       4       com.oracle.truffle.runtime.hotspot.HotSpotFastThreadLocal::set (5 bytes)   (hosted JVMCI compilation)
1582 JVMCI:10125       4       com.oracle.truffle.runtime.OptimizedCallTarget::profiledPERoot (51 bytes)   (hosted JVMCI compilation)
1591 JVMCI:10899       4       com.oracle.truffle.runtime.OptimizedCallTarget::profiledPERoot (51 bytes)   (hosted JVMCI compilation)
1652 JVMCI:11064       4       com.oracle.truffle.runtime.OptimizedCallTarget::profiledPERoot (51 bytes)   (hosted JVMCI compilation)
1656 JVMCI:11175       4       com.oracle.truffle.runtime.OptimizedCallTarget::profiledPERoot (51 bytes)   (hosted JVMCI compilation)

/cc @dougxc


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-8336760: [JVMCI] -XX:+PrintCompilation should also print "hosted" JVMCI compilations (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 23278

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

Using diff file

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

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 23, 2025

👋 Welcome back cslucas! 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 Jan 23, 2025

@JohnTortugo 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:

8336760: [JVMCI] -XX:+PrintCompilation should also print "hosted" JVMCI compilations

Reviewed-by: dnsimon, kvn

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 57 new commits pushed to the master branch:

  • a224f12: 8348205: Improve cutover time selection when building available currencies set
  • 8103256: 8348348: Remove unnecessary #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c
  • fb066ca: 8347272: [ubsan] JvmLauncher.cpp:262:52: runtime error: applying non-zero offset 40 to null pointer
  • 5fec999: 8339668: Parallel: Adopt PartialArrayState to consolidate marking stack in Full GC
  • 2bef5b4: 8348323: Corrupted timezone string in JVM crash log
  • 3a8680e: 8347058: When automatically translating the page to pt-br, all CSS styling disappears
  • a4942a2: 8348286: [AIX] clang 17 introduces new warning Wtentative-Definitions which produces Build errors
  • 558255a: 8328919: Add BodyHandlers / BodySubscribers methods to handle excessive server input
  • 1f74caa: 8348401: [IR Framework] PrintTimes should not require verbose
  • f71541c: 8344976: Remove the jmx.invoke.getters compatibility property
  • ... and 47 more: https://git.openjdk.org/jdk/compare/356e2a8f48679ea31f1483cf60803818934fc53f...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dougxc, @vnkozlov, @simonis) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 23, 2025
@openjdk
Copy link

openjdk bot commented Jan 23, 2025

@JohnTortugo
The label @dougxc is not a valid label.
These labels are valid:

  • graal
  • serviceability
  • hotspot
  • hotspot-compiler
  • ide-support
  • kulla
  • i18n
  • shenandoah
  • jdk
  • javadoc
  • security
  • hotspot-runtime
  • jmx
  • build
  • nio
  • client
  • core-libs
  • compiler
  • net
  • hotspot-gc
  • hotspot-jfr

@openjdk
Copy link

openjdk bot commented Jan 23, 2025

@JohnTortugo The following labels will be automatically applied to this pull request:

  • graal
  • hotspot-compiler

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

@openjdk openjdk bot added graal graal-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org labels Jan 23, 2025
@mlbridge
Copy link

mlbridge bot commented Jan 23, 2025

Webrevs

@JohnTortugo JohnTortugo force-pushed the print_jvmci_hosted_compilations branch from 3c2f720 to 92f15db Compare January 23, 2025 23:12
@openjdk
Copy link

openjdk bot commented Jan 23, 2025

@JohnTortugo Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information.

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 reasonable to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jan 24, 2025
Copy link
Contributor

@vnkozlov vnkozlov left a comment

Choose a reason for hiding this comment

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

What about -XX:+PrintCompilation2 output? And -XX:+CITime?
Are these flags applicable for "hosted" compilation?

@JohnTortugo
Copy link
Contributor Author

What about -XX:+PrintCompilation2 output? And -XX:+CITime? Are these flags applicable for "hosted" compilation?

I created another RFE to evaluate if we need that and if so work on it: https://bugs.openjdk.org/browse/JDK-8348621

@simonis
Copy link
Member

simonis commented Jan 27, 2025

Notice that -XX:+CITime is already aware of "hosted" JVMCI compilations. This is how the output looks if we only have "hosted" JVMCI compilations (i.e. -XX:+UseJVMCICompiler):

    JVMCI CompileBroker Time:
       Compile:          0,000 s
       Install Code:     0,000 s (installs: 0, CodeBlob total size: 0, CodeBlob code size: 0)

    JVMCI Hosted Time:
       Install Code:     0,153 s (installs: 28, CodeBlob total size: 120888, CodeBlob code size: 80840)

And this is how it looks like with -XX:+UseJVMCICompiler:

    JVMCI CompileBroker Time:
       Compile:         21,054 s
       Install Code:     0,307 s (installs: 841, CodeBlob total size: 985832, CodeBlob code size: 673184)

    JVMCI Hosted Time:
       Install Code:     0,165 s (installs: 31, CodeBlob total size: 146368, CodeBlob code size: 94808)

The "hosted" section has no entry for the compilation time, but it still prints the nunmber of compiled methods and their size.

Copy link
Member

@simonis simonis left a comment

Choose a reason for hiding this comment

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

Can you please include compileTask.hpp where CompileTask::print(..) is declared? I understand that it somehow gets included implicitly already, but I'd like to make the dependency explicit.

And also updated the copyright year please :)

Otherwise looks good.

@JohnTortugo
Copy link
Contributor Author

And also updated the copyright year please :)

I'm not sure I understand what you mean here? Shouldn't it be 2025?

@simonis
Copy link
Member

simonis commented Jan 28, 2025

And also updated the copyright year please :)

I'm not sure I understand what you mean here? Shouldn't it be 2025?

Sorry, I missed that the copyright was already updated this year. That happens if you don't pull every day :)

@JohnTortugo
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jan 28, 2025
@openjdk
Copy link

openjdk bot commented Jan 28, 2025

@JohnTortugo
Your change (at version f49ca1e) is now ready to be sponsored by a Committer.

@vnkozlov
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jan 28, 2025

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

  • 9f4d3de: 8347718: Unexpected NullPointerException in C2 compiled code due to ReduceAllocationMerges
  • a224f12: 8348205: Improve cutover time selection when building available currencies set
  • 8103256: 8348348: Remove unnecessary #ifdef STATIC_BUILD around DEF_STATIC_JNI_OnLoad from zip_util.c
  • fb066ca: 8347272: [ubsan] JvmLauncher.cpp:262:52: runtime error: applying non-zero offset 40 to null pointer
  • 5fec999: 8339668: Parallel: Adopt PartialArrayState to consolidate marking stack in Full GC
  • 2bef5b4: 8348323: Corrupted timezone string in JVM crash log
  • 3a8680e: 8347058: When automatically translating the page to pt-br, all CSS styling disappears
  • a4942a2: 8348286: [AIX] clang 17 introduces new warning Wtentative-Definitions which produces Build errors
  • 558255a: 8328919: Add BodyHandlers / BodySubscribers methods to handle excessive server input
  • 1f74caa: 8348401: [IR Framework] PrintTimes should not require verbose
  • ... and 48 more: https://git.openjdk.org/jdk/compare/356e2a8f48679ea31f1483cf60803818934fc53f...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jan 28, 2025
@openjdk openjdk bot closed this Jan 28, 2025
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 28, 2025
@openjdk openjdk bot removed the sponsor Pull request is ready to be sponsored label Jan 28, 2025
@openjdk
Copy link

openjdk bot commented Jan 28, 2025

@vnkozlov @JohnTortugo Pushed as commit c3c3888.

💡 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

graal graal-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants