RFR: 8276787: Improve warning messages for -XX:+RecordDynamicDumpInfo

Calvin Cheung ccheung at openjdk.java.net
Mon Nov 15 23:03:38 UTC 2021


On Mon, 15 Nov 2021 07:50:13 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> [1] Fixed the error messages for the three scenarios described in the bug report. See the test SharedArchiveFileOption.java for new test cases for these messages.
> 
> [2] The global SharedDynamicArchivePath was used for both reading and writing the dynamic archive. Now the writing part is handled by DynamicArchiveBuilder::_archive_name. This simplifies the logic in Arguments::init_shared_archive_paths() and DynamicArchive::dump_for_jcmd(). It also makes the checks in [1] easier to implement.
> 
> Testing: running through Oracle CI tiers 1-4.

Looks good. Some minor comments in arguments.cpp and the testcase.

src/hotspot/share/runtime/arguments.cpp line 3497:

> 3495: 
> 3496: void Arguments::init_shared_archive_paths() {
> 3497:   if (ArchiveClassesAtExit != NULL) {

Maybe change `NULL` to `nullptr` since your new code below in the same function uses `nullptr`?

src/hotspot/share/runtime/arguments.cpp line 3504:

> 3502:     }
> 3503:     check_unsupported_dumping_properties();
> 3504:     SharedDynamicArchivePath = os::strdup_check_oom(ArchiveClassesAtExit, mtArguments);

I think it is clearer to leave this assignment alone.
It works in your current patch because in line 3561, the `ArchiveClassesAtExit` is used instead of `SharedDynamicArchivePath`.

src/hotspot/share/runtime/arguments.cpp line 3505:

> 3503:   }
> 3504: 
> 3505:   if (SharedArchiveFile == NULL) {

`Null` to `nullptr`?

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/SharedArchiveFileOption.java line 35:

> 33:  * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
> 34:  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. SharedArchiveFileOption
> 35:  */

Please add `@bug` in the header section.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6383


More information about the hotspot-runtime-dev mailing list