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

Allow -Xlog:aot to be used as an alias for -Xlog:cds when using AOT cache

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 25
    • None
    • hotspot

      New UL log messages for the AOT cache are implemented using the "aot" tag. For example, in JDK-8350209: Preserve adapters in AOT cache, we are adding -Xlog:aot+codecache+init.

      However, for historical reasons, many log message for the AOT cache use the "cds" tag. E.g.,

          java -XX:AOTCache=foo.aot -cp foo.jar -Xlog:cds,cds+module Foo

      For a consistent user interface, we should make it possible for the user to get log messages about the AOT cache using -Xlog:aot. E.g.,

          java -XX:AOTCache=foo.aot -cp foo.jar -Xlog:aot,aot+module Foo

      Some existing user scripts may rely on the "cds" logging output, so we should go through a deprecation process before we retire the "cds" log. For the time being, we should make "aot" as an alias of "cds" ONLY when we are using the AOT cache with the command-line options specified in JEP 483 and JEP 514

      =======================
      Specification:

      When the JVM is started with any of the following options: AOTCache, AOTCacheOutput, AOTConfiguration, AOTMode:

      - Any -Xlog options that starts with the "aot" tag should also match any LogTagSets whose first tag is LogTag::_cds
      - When printing a LogTagSets whose first tag is LogTag::_cds, if its "tags" decoration is to be printed, then the first tag in the decoration should be printed as "aot".

      =======================
      Examples:

      # control case -- this is an example of an old "cds" log. The decoration should be printed as "cds" to be backwards compatible
      $ java -Xshare:auto -Xlog:cds --version | grep trying
      [0.003s][info][cds] trying to map /jdk3/bld/vox/images/jdk/lib/server/classes.jsa

      # "aot" can be used to select the "cds" log, but the log will be printed with "aot" as its decoration
      $ java -XX:AOTMode=auto -Xlog:aot --version | grep trying
      [0.015s][info][aot] trying to map /jdk3/bld/vox/images/jdk/lib/server/classes.jsa

      # When using new -XX:AOT flags, even if you specify -Xlog:cds, the output will use "aot" decoration
      $ java -XX:AOTMode=auto -Xlog:cds --version | grep tryi
      [0.004s][info][aot] trying to map /jdk3/bld/vox/images/jdk/lib/server/classes.jsa

      # When using new -XX:AOT flags, error messages should be logged with "aot" decoration even when no -Xlog flags are specified
      $ java -XX:AOTMode=auto -XX:AOTCache=nofile.aot --version
      [0.009s][error][aot] An error has occurred while processing the AOT cache. Run with -Xlog:aot for details.
      [0.009s][error][aot] Loading AOT cache failed: nofile.aot
      java 25-internal 2025-09-16
      Java(TM) SE Runtime Environment (build 25-internal-adhoc.iklam.vox)
      Java HotSpot(TM) 64-Bit Server VM (build 25-internal-adhoc.iklam.vox, mixed mode)

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

              Created:
              Updated:
              Resolved: