Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8356595

Convert -Xlog:cds to -Xlog:aot

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • None
    • hotspot

      The long time HotSpot feature of CDS has been rebranded as AOT since JEP 483. For a consistent user experience, we should allow the user to print logs related to AOT using -Xlog:aot.

      We have many existing logs that start with the [cds] tag.


      The MAJORITY of these logs are for trouble shooting the internal implementation by HotSpot developers. Such logs should be unconditionally converted to use the [aot] tag.

      Example:

            if (log_is_enabled(Debug, cds)) {
              ResourceMark rm(THREAD);
              log_debug(cds)(" calling %s", method->name_and_sig_as_C_string());
            }

      ->

            if (log_is_enabled(Debug, aot)) {
              ResourceMark rm(THREAD);
              log_debug(aot)(" calling %s", method->name_and_sig_as_C_string());
            }

      However, there are a few logs that are related to failure conditions with using the CDS archive/AOT cache. Existing user scripts may run with -Xlog:cds and depend on the contents of these logs for diagnostic purposes. E.g.

            log_info(aot)("trying to map %s%s", info, _full_path);
            log_warning(cds)("Unable to read the file header.");

      To ease the transition from CDS to AOT, we should try to make such diagnostic logs available under both -Xlog:cds and -Xlog:aot. The proposal is to convert such logs in the HotSpot source code to:

            aot_log_info(aot)("trying to map %s%s", info, _full_path);
            aot_log_warning(aot)("Unable to read the file header.");

      When running the "new" AOT workflow, these logs appear in the [aot] channel

           $ java -Xlog:aot -XX:AOTCache=bad.aot ...
           [0.020s][info][cds] trying to map bad.jsa
           [0.020s][warning][cds] Unable to read the file header

      However, when running with the "old" CDS workflow, these logs appear in the [cds] channel, so that they can be parsed be existing user scripts.

            $ java -Xlog:cds -XX:SharedArchiveFile=bad.jsa ...
            [0.020s][info][cds] trying to map bad.jsa
            [0.020s][warning][cds] Unable to read the file header

      This output flexibility is implemented by the new aot_log_xxx macros. The implementation will be described in the Pull Request.





            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: