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

8311946: add support for libgraal specific jtreg tests #14851

Closed
wants to merge 8 commits into from

Conversation

dougxc
Copy link
Member

@dougxc dougxc commented Jul 12, 2023

This PR adds support for jdk.hasLibgraal and vm.libgraal.enabled properties that can be used with the jtreg @requires tag to determine if a libgraal specific test should run.

  • jdk.hasLibgraal: the libgraal shared library file is present
  • vm.libgraal.enabled: libgraal is used as JIT compiler

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-8311946: Add support for libgraal specific jtreg tests (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14851

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 12, 2023

👋 Welcome back dnsimon! 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 openjdk bot added the rfr Pull request is ready for review label Jul 12, 2023
@openjdk
Copy link

openjdk bot commented Jul 12, 2023

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

  • hotspot

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 hotspot-dev@openjdk.org label Jul 12, 2023
@mlbridge
Copy link

mlbridge bot commented Jul 12, 2023

Webrevs

if (!isGraalEnabled()) {
return false;
}
Boolean useJvmciNativeLibrary = WB.getBooleanVMFlag("UseJVMCICompiler");
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: "UseJVMCICompiler". Should be "UseJVMCINativeLibrary".

Copy link
Member Author

Choose a reason for hiding this comment

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

That's embarrassing! Thanks for catching it.

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.

Good.

@openjdk
Copy link

openjdk bot commented Jul 12, 2023

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

8311946: add support for libgraal specific jtreg tests

Reviewed-by: kvn, thartmann

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

  • 43099a8: 8311647: Memory leak in Java_jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl_ttyname_1r
  • c7c6d47: 6355567: AdobeMarkerSegment causes failure to read valid JPEG
  • af7f95e: 8310070: Test: javax/net/ssl/DTLS/DTLSWontNegotiateV10.java timed out
  • c710e71: 8311102: Write annotations in the classfile dumped by SA
  • 61932f4: 8244289: fatal error: Possible safepoint reached by thread that does not allow it
  • 8c9d091: 8308047: java/util/concurrent/ScheduledThreadPoolExecutor/BasicCancelTest.java timed out and also had jcmd pipe errors
  • b587fc5: 8312013: avoid UnixConstants.java.template warning: 'linux' is not defined on AIX
  • 135f64e: 8311583: tableswitch broken by JDK-8310577
  • 6895deb: 8311536: JFR TestNativeMemoryUsageEvents fails in huge pages configuration
  • bb5278d: 8311239: GC: Remove trailing blank lines in source files
  • ... and 2 more: https://git.openjdk.org/jdk/compare/1b0dd7c254dc1a087874c8726d8d26b9a41d4145...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 ready Pull request is ready to be integrated label Jul 12, 2023
Copy link
Member

@TobiHartmann TobiHartmann left a comment

Choose a reason for hiding this comment

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

Looks good.

@dougxc
Copy link
Member Author

dougxc commented Jul 13, 2023

I have pushed further changes to fix a bug (vm.libgraal.enabled was returning VMProps.isGraalEnabled()) and to add the vm.libgraal property. The latter is actually what one mostly often wants as it lets libgraal specific tests run on a JDK that includes libgraal but does not enable it by default without having to put TEST_OPTS=JAVA_OPTIONS="-XX:+UnlockExperimentalVMOptions -XX:+UseJVMCICompiler on the make test command line.

Please re-review in light of these changes.

@@ -123,6 +123,10 @@ public Map<String, String> call() {
map.put("vm.continuations", this::vmContinuations);
// vm.graal.enabled is true if Graal is used as JIT
map.put("vm.graal.enabled", this::isGraalEnabled);
// vm.libgraal is true if the libgraal shared library file is present
map.put("vm.libgraal", this::hasLibraal);
Copy link
Contributor

Choose a reason for hiding this comment

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

May be the property also should be named "vm.hasLibgraal" to be clear what it means.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not so sure. The current naming seems consistent with other existing properties:

map.put("vm.jvmti", this::vmHasJVMTI);
map.put("vm.jvmci", this::vmJvmci);

However, I can change it if you insist.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer naming similar to "vm.hasJFR", "vm.hasSA", "vm.hasDTrace". It is unfortunate that we used "vm.jvmci" and "vm.jvmti" naming to check presence of features.

Also libgraal is not part of VM. May be you need to use "jdk.hasLibgraal". There are other properties which use "jdk." already.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, hasLibgraal is fine.
In what sense is libgraal not part of the VM? I would have thought that a JIT compiler is more "vm" than "jdk"?

Copy link
Contributor

Choose a reason for hiding this comment

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

In a sense that the libgraal file is separate from VM and its generation is not part of HotSpot VM build.
hasLibgraal property checks the presence of this separate file and not a feature which is part of VM build (like jvmci).

Copy link
Contributor

@vnkozlov vnkozlov Jul 13, 2023

Choose a reason for hiding this comment

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

"vm.libgraal.enabled" is VM's property because it enables VM's Graal JIT version which uses code in libgraal.

Copy link
Contributor

Choose a reason for hiding this comment

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

On other hand, it is not really big matter. I am fine with "vm. hasLibgraal" since it is used only by VM.

Copy link
Member Author

Choose a reason for hiding this comment

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

You've convinced me - I'll rename it to jdk.hasLibgraal.

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.

Good.

*
* @return true if the libgraal shared library file is present.
*/
protected String hasLibraal() {
Copy link
Member

Choose a reason for hiding this comment

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

Typo: 'g' is missing

@dougxc
Copy link
Member Author

dougxc commented Jul 14, 2023

Thanks for the reviews.

/integrate

@openjdk
Copy link

openjdk bot commented Jul 14, 2023

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

  • 167d1c1: 8311986: Disable runtime/os/TestTracePageSizes.java for ShenandoahGC
  • 7539cc0: 8303134: JFR: Missing stack trace during chunk rotation stress
  • d1fa1a8: 8311825: Duplicate qualified enum constants not detected
  • 4676b40: 8312049: runtime/logging/ClassLoadUnloadTest can be improved
  • bbb7ce5: 8311038: Incorrect exhaustivity computation
  • 2e12a12: 8281658: Add a security category to the java -XshowSettings option
  • 43099a8: 8311647: Memory leak in Java_jdk_internal_org_jline_terminal_impl_jna_linux_CLibraryImpl_ttyname_1r
  • c7c6d47: 6355567: AdobeMarkerSegment causes failure to read valid JPEG
  • af7f95e: 8310070: Test: javax/net/ssl/DTLS/DTLSWontNegotiateV10.java timed out
  • c710e71: 8311102: Write annotations in the classfile dumped by SA
  • ... and 8 more: https://git.openjdk.org/jdk/compare/1b0dd7c254dc1a087874c8726d8d26b9a41d4145...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jul 14, 2023

@dougxc Pushed as commit a63f865.

💡 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 hotspot-dev@openjdk.org integrated Pull request has been integrated
4 participants