14 RFR (M) 8232080: jlink plugins for vendor information and run-time options

Bob Vandette bob.vandette at oracle.com
Wed Oct 23 19:37:56 UTC 2019



> On Oct 23, 2019, at 3:07 PM, mark.reinhold at oracle.com wrote:
> 
> 2019/10/22 15:36:28 -0700, mark.reinhold at oracle.com:
>> 2019/10/22 12:43:42 -0700, bob.vandette at oracle.com:
>>>> On Oct 22, 2019, at 3:22 PM, mark.reinhold at oracle.com wrote:
>>>> 2019/10/22 10:31:55 -0700, bob.vandette at oracle.com:
>>>>> In arguments.cpp, could you use a new JVMFlag to declare options
>>>>> that came from this resource as RESOURCE?
>>>>> 
>>>>> - jint result = parse_each_vm_init_arg(vm_options_args, &patch_mod_javabase, JVMFlag::INTERNAL);
>>>>> + jint result = parse_each_vm_init_arg(vm_options_args, &patch_mod_javabase, JVMFlag::RESOURCE);
>>>>> 
>>>>> This will require some minor changes to jvmFlags.hpp
>>>>> 
>>>>> ...
>>>> 
>>>> Yes, that’d make sense, in which case I’d also change JVMFlag::print_origin
>>>> to handle the RESOURCE case (which is easy).
>>>> 
>>>> Is “RESOURCE” the best name here?  Sounds awfully generic.  How about
>>>> “JIMAGE” or “JIMAGE_RESOURCE”?
>>> 
>>> JIMAGE_RESOURCE or VM_OPTIONS_RESOURCE  works for me.
>> 
>> JIMAGE_RESOURCE it is, then.  Relative patch below; original webrev
>> updated in place (https://cr.openjdk.java.net/~mr/rev/8232080/).
> 
> Addendum: To keep things sane for JFR and the serviceability agent,
> I had to propagate this change through to those subsystems.
> 
> Relative patch below; original webrev updated in place
> (https://cr.openjdk.java.net/~mr/rev/8232080/).
> 
> Okay?

Looks good.  I’m sure you did this but I scanned the entire JDK sources and didn’t see any other uses of JVMFlag:: that would need to be updated.

Bob.


> 
> - Mark
> 
> ----
> 
> # HG changeset patch
> # Parent  d3f05e3b0d76e1a74a10cee180d8953d3045b6c8
> Addendum 3 (propagate JIMAGE_RESOURCE): 8232080: jlink plugins for vendor information and run-time options
> 
> diff --git a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp
> --- a/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp
> +++ b/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp
> @@ -134,6 +134,7 @@
>     case JVMFlag::ERGONOMIC: return "Ergonomic";
>     case JVMFlag::ATTACH_ON_DEMAND: return "Attach on demand";
>     case JVMFlag::INTERNAL: return "Internal";
> +    case JVMFlag::JIMAGE_RESOURCE: return "JImage resource";
>     default: ShouldNotReachHere(); return "";
>   }
> }
> diff --git a/src/hotspot/share/runtime/vmStructs.cpp b/src/hotspot/share/runtime/vmStructs.cpp
> --- a/src/hotspot/share/runtime/vmStructs.cpp
> +++ b/src/hotspot/share/runtime/vmStructs.cpp
> @@ -2612,6 +2612,7 @@
>   declare_constant(JVMFlag::ERGONOMIC)                                    \
>   declare_constant(JVMFlag::ATTACH_ON_DEMAND)                             \
>   declare_constant(JVMFlag::INTERNAL)                                     \
> +  declare_constant(JVMFlag::JIMAGE_RESOURCE)                              \
>   declare_constant(JVMFlag::VALUE_ORIGIN_MASK)                            \
>   declare_constant(JVMFlag::ORIG_COMMAND_LINE)
> 
> diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Flags.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Flags.java
> --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Flags.java
> +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Flags.java
> @@ -35,7 +35,8 @@
>   MANAGEMENT ("Management"),
>   ERGONOMIC ("Ergonomic"),
>   ATTACH_ON_DEMAND ("Attach on demand"),
> -  INTERNAL ("Internal");
> +  INTERNAL ("Internal"),
> +  JIMAGE_RESOURCE ("JImage");
> 
>   private final String value;
> 
> diff --git a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java
> --- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java
> +++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java
> @@ -114,6 +114,7 @@
>   public static int    Flags_ERGONOMIC;
>   public static int    Flags_ATTACH_ON_DEMAND;
>   public static int    Flags_INTERNAL;
> +  public static int    Flags_JIMAGE_RESOURCE;
>   private static int   Flags_VALUE_ORIGIN_MASK;
>   private static int   Flags_ORIG_COMMAND_LINE;
>   /** This is only present in a non-core build */
> @@ -200,6 +201,8 @@
>             return "attach";
>         } else if (origin == Flags_INTERNAL) {
>             return "internal";
> +        } else if (origin == Flags_JIMAGE_RESOURCE) {
> +            return "jimage";
>         } else {
>             throw new IllegalStateException(
>                 "Unknown flag origin " + origin + " is detected in " + name);
> @@ -484,6 +487,7 @@
>     Flags_ERGONOMIC = db.lookupIntConstant("JVMFlag::ERGONOMIC").intValue();
>     Flags_ATTACH_ON_DEMAND = db.lookupIntConstant("JVMFlag::ATTACH_ON_DEMAND").intValue();
>     Flags_INTERNAL = db.lookupIntConstant("JVMFlag::INTERNAL").intValue();
> +    Flags_JIMAGE_RESOURCE = db.lookupIntConstant("JVMFlag::JIMAGE").intValue();
>     Flags_VALUE_ORIGIN_MASK = db.lookupIntConstant("JVMFlag::VALUE_ORIGIN_MASK").intValue();
>     Flags_ORIG_COMMAND_LINE = db.lookupIntConstant("JVMFlag::ORIG_COMMAND_LINE").intValue();
>     oopSize  = db.lookupIntConstant("oopSize").intValue();




More information about the build-dev mailing list