RFR (L): 8024545: make develop and notproduct flag values available in product builds

Christian Thalinger christian.thalinger at oracle.com
Wed Sep 11 16:29:45 PDT 2013


On Sep 11, 2013, at 2:40 PM, Joseph Provino <joseph.provino at oracle.com> wrote:

> 
> On 9/11/2013 5:30 PM, Christian Thalinger wrote:
>> On Sep 11, 2013, at 1:22 PM, Joseph Provino <joseph.provino at oracle.com> wrote:
>> 
>>> On 9/11/2013 12:55 PM, Christian Thalinger wrote:
>>>> On Sep 10, 2013, at 5:56 PM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>>>> 
>>>>> http://cr.openjdk.java.net/~twisti/8024545/webrev/
>>>>> 
>>>>> 8024545: make develop and notproduct flag values available in product builds
>>>>> Reviewed-by:
>>>>> 
>>>>> Right now the internal flag table only contains flags which are defined in a product build. This does not include develop and notproduct flags. Sometimes it is useful to have access to these values for post-mortem core file analysis or to read these values for compiler settings for a Java-based compiler.
>>>>> 
>>>>> This change enables develop and notproduct flag values to be read by the serviceability agent. The binary size is increased by 42k for a 64-bit product build and by 32k for a 32-bit product build.
>>>> Btw. I missed the perhaps most important data point:  a linux_i486_minimal1 product build is increased by 22k.
>>>> 
>>>> If that's too much we could disable this feature for minimal builds.
>>> A 22k increase still keeps the minimal VM under 3.5M which is what we requested in a CCC.
>>> 
>>> However, there are features excluded from the minimal VM such as SA so it doesn't make
>>> sense to allow those options.
>> Right.  I saw that minimal also doesn't build vmStructs.
>> 
>> Question:  could the additional information be useful in GDB debugging?
> 
> Hi Chris, I'm not sure what you mean.  I was thinking of options you don't want to allow
> because they won't do anything in the minimal vm.

Eh, let me explain again.  The purpose of this change is to be able to read the values of all flags used in a binary; even develop and notproduct ones.  This might be helpful to get the value for e.g. C1's InstructionCountCutoff flag without going back to the source code and dig it out.  Especially helpful if it happens to be a value that changes over time between releases.

But this is just a nice side effect.  The actual motivation is to be able to use the same constant values as the VM's C++ code in a JIT compiler that is written in Java.  One good example here is BciProfileWidth.  Right now this is a develop flag and has the default value of 2.  But this could change any time and we need to use the same value in Java as well.

-- Chris

> 
> joe
> 
>> 
>> -- Chris
>> 
>>> joe
>>> 
>>>> -- Chris
>>>> 
>>>>> Before:
>>>>> 
>>>>> $ java -cp /java/re/jdk/8/latest/binaries/linux-x64/lib/sa-jdi.jar sun.jvm.hotspot.CLHSDB 9399
>>>>> Attaching to process 9399, please wait...
>>>>> hsdb> flags -nd
>>>>> InitialHeapSize = 495006528 5
>>>>> MaxHeapSize = 7920943104 5
>>>>> UseCompressedKlassPointers = true 5
>>>>> UseCompressedOops = true 5
>>>>> UseParallelGC = true 5
>>>>> hsdb> flags InlineMathNatives
>>>>> Couldn't find flag: InlineMathNatives
>>>>> 
>>>>> After:
>>>>> 
>>>>> $ java -cp $JAVA_HOME/lib/sa-jdi.jar sun.jvm.hotspot.CLHSDB 3726
>>>>> Attaching to process 3726, please wait...
>>>>> hsdb> flags -nd
>>>>> InitialHeapSize = 495006528 5
>>>>> MaxHeapSize = 7920943104 5
>>>>> UseCompressedKlassPointers = true 5
>>>>> UseCompressedOops = true 5
>>>>> UseParallelGC = true 5
>>>>> hsdb> flags InlineMathNatives
>>>>> InlineMathNatives = true 0
>>>>> 
>>>>> This patch has one behavioral difference; when printing flags with e.g. PrintFlagsFinal in a debug build it prints "develop" for develop flags:
>>>>> 
>>>>>    uintx AdaptiveSizePolicyGCTimeLimitThreshold    = 5               {develop}
>>>>> 
>>>>> The output for product builds is unchanged.
> 



More information about the hotspot-dev mailing list