Skip to content

8300829: Make CtwRunner available as an independent tool#13344

Closed
caojoshua wants to merge 5 commits intoopenjdk:masterfrom
caojoshua:8300829
Closed

8300829: Make CtwRunner available as an independent tool#13344
caojoshua wants to merge 5 commits intoopenjdk:masterfrom
caojoshua:8300829

Conversation

@caojoshua
Copy link
Contributor

@caojoshua caojoshua commented Apr 5, 2023

  1. Create an independent jar file with CtwRunner as the main class to make it easier to run. Not needed anymore thanks to @navyxliu 's comments. We can use the original ctw.jar because it already has ctwrunner class.
  2. Output the class files directly into the destination directory. Currently, CTW expects a wb.jar, but the jtreg tests that use CTWRunner has class files outside of a jar.
  3. Introduce sun.hotspot.tools.ctwrunner.ctw_extra_args option to pass extra arguments to CTW. Arguments are comma separated because working with spaces in bash can be kind of awkward, but I'm open to changing this part.

Motivation

CTWRunner is a wrapper around CTW that will continue compiling beyond failure. It can be useful for testing compilation with certain flags. For example, one could run

JAVA_OPTIONS="-Dsun.hotspot.tools.ctwrunner.ctw_extra_args=-XX:+StressLCM,-XX:+StressGCM" ./ctwrunner.sh modules:java.base

To test compiling the java.base module with -XX:+StressLCM -XX:+StressGCM. This is advantageous over uses CTW because we can see the full list of crashes for the entire module.


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-8300829: Make CtwRunner available as an independent tool

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13344

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 5, 2023

👋 Welcome back caojoshua! 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 Apr 5, 2023
@openjdk
Copy link

openjdk bot commented Apr 5, 2023

@caojoshua 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 Apr 5, 2023
@mlbridge
Copy link

mlbridge bot commented Apr 5, 2023

Webrevs

$(JAR) --create --file=$@ --main-class $(CTW_MAIN_CLASS) -C $(OUTPUT_DIR) .
@rm -rf $(OUTPUT_DIR)

$(DST_DIR)/ctwrunner.jar: filelist $(DST_DIR)/wb.jar
Copy link
Member

Choose a reason for hiding this comment

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

Theoretically, we can avoid from generating ctwrunner.jar. The classes are the same as 'ctw.jar' and the only different part is the entry point.

to launch CTWRunner, you can do thing like this in ctwruner.sh

echo '$${JAVA_HOME}/bin/java $${JAVA_OPTIONS} -Dtest.jdk=$${JAVA_HOME} -cp ctw.jar $CTWRUNNER_MAIN_CLASS  $$@' > $@

it's up to you. if we generate ctwrunner.jar, we will have a "standalone" jar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed ctwrunner.jar in newest commit.

I also realized I was javac'ing twice. We avoid this entirely by removing the extra jar.

* Value of {@code -Dsun.hotspot.tools.ctwrunner.ctw_extra_args}. Extra
* comma-separated arguments to pass to CTW subprocesses.
*/
public static final String CTW_EXTRA_ARGS
Copy link
Member

Choose a reason for hiding this comment

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

how about you use getProperty("sun.hotspot.tools.ctwrunner.ctw_extra_args", "").
by giving it an empty string as default value, you can take iout if (null != CTW_EXTRA_ARGS) below.

btw, you may also need to update the year in the copyrights header.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup. Made these changes.

Copy link
Member

Choose a reason for hiding this comment

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

Better to make CTW_EXTRA_ARGS private. If it's needed outside this class, add a public accessor. Don't think it's needed outside though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made it private. Not needed outside.

Copy link
Member

@navyxliu navyxliu left a comment

Choose a reason for hiding this comment

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

LGTM. I am not a reviewer. need other reviewers to approve this.

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.

Lgtm.

@openjdk
Copy link

openjdk bot commented Apr 6, 2023

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

8300829: Make CtwRunner available as an independent tool

Reviewed-by: xliu, phh

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

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 (@navyxliu, @phohensee) 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 ready Pull request is ready to be integrated label Apr 6, 2023
@caojoshua
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Apr 6, 2023
@openjdk
Copy link

openjdk bot commented Apr 6, 2023

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

@phohensee
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Apr 7, 2023

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Apr 7, 2023

@phohensee @caojoshua Pushed as commit 314e9b3.

💡 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.

3 participants