RFR: 8300829: Make CtwRunner available as an independent tool
Xin Liu
xliu at openjdk.org
Wed Apr 5 05:08:12 UTC 2023
On Wed, 5 Apr 2023 04:46:21 GMT, Joshua Cao <duke at openjdk.org> wrote:
> 1. Create an independent jar file with CtwRunner as the main class to make it easier to run
> 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.
test/hotspot/jtreg/testlibrary/ctw/Makefile line 94:
> 92: @rm -rf $(OUTPUT_DIR)
> 93:
> 94: $(DST_DIR)/ctwrunner.jar: filelist $(DST_DIR)/wb.jar
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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13344#discussion_r1158027103
More information about the hotspot-compiler-dev
mailing list