RFR(S): 8209598: Use log_error for error message in CDS code

Ioi Lam ioi.lam at oracle.com
Wed Oct 24 00:18:27 UTC 2018


Hi Calvin,

    if (PrintSharedArchiveAndExit) {
      if (PrintSharedDictionary) {
-      tty->print_cr("\nShared classes:\n");
+      log_info(cds)("\nShared classes:\n");
        SystemDictionary::print_shared(tty);
      }
      if (_archive_loading_failed) {
-      tty->print_cr("archive is invalid");
+      log_error(cds)("archive is invalid");
        vm_exit(1);
      } else {
-      tty->print_cr("archive is valid");
+      log_info(cds)("archive is valid");
        vm_exit(0);
      }
    }

I think this part should use print_cr, because the option says "Print 
...". It shouldn't be necessary to explicitly set -Xlog:cds in order to 
get the printed message.

If you revert this, I think the two test cases also can be reverted.

The rest of the changes  look OK.

Thanks

- Ioi


On 10/23/18 2:45 PM, Calvin Cheung wrote:
> bug: https://bugs.openjdk.java.net/browse/JDK-8209598
>
> webrev: http://cr.openjdk.java.net/~ccheung/8209598/webrev.00/
>
> Use log_error(cds) instead of tty->print_cr for CDS error messages. 
> Also converted 2 CDS info messages to log_info(cds).
>
> Testing: mach5 hs-tier{1,2,3}
>
> thanks,
> Calvin



More information about the hotspot-runtime-dev mailing list