Re: slowproduct build

2018-04-12 Thread Magnus Ihse Bursie

On 2018-04-11 07:12, Ioi Lam wrote:




On 4/10/18 2:21 PM, Magnus Ihse Bursie wrote:


On 2018-04-10 23:08, Ioi Lam wrote:

Yes that’s what I want.

Yesterday I was using gdb to step into the interpreter generation 
code to see what’s generated for a particular routine for 
MethodHandles. The debug build contains a LOT of runtime 
verification code in the generated code and I couldn’t figure out 
what’s happening. The product build just generates 10 instructions.
So you want to have a way to force -O0 for all compiled files? 
Something like "bash configure --with-debug-level=release 
--with-optimization=none", or possibly "make OPTIMIZATION=NONE"?



Hi Magnus,

I like the --with-optimization=none flag. This doesn't seem to exist 
yet. Any plans to add it?


Yes, it does not exist yet. :) I'm trying out various scenarios here to 
understand what you need and how we can fix it.


I have opened https://bugs.openjdk.java.net/browse/JDK-8201485, however 
to be frank, it is of quite low priority (infrequence and odd use case, 
workaround exists) so I assume it will take a while before I or anyone 
else comes around to it.


/Magnus




The way I would use it is:

    bash configure --with-debug-level=product --with-optimization=none

Thanks
- Ioi

Or are you happy with the optimization level of a slowdebug build, 
and only want to adjust the value of PRODUCT and ASSERT for hotspot 
to match what's done for a release build? Something like "bash 
configure --enable-hotspot-product-build"?


/Magnus



Thanks
Ioi

On Apr 10, 2018, at 1:47 PM, Thomas Stüfe > wrote:


If I understand Ioi correctly, he wants a build with PRODUCT and 
!ASSERT but with debug symbols and no optimizations? So, no 
assertions and all switches with product defaults?


I can see that this could make sense in certain scenarios.

..Thomas

On Tue, Apr 10, 2018 at 10:27 PM, Magnus Ihse Bursie 
> wrote:


On 2018-04-10 02:00, Ioi Lam wrote:

Sometimes I want to debug the product build (I can't bother
with turning off all the trueInDebug options in the hotspot
globals.hpp). The only way that I have found to do this is:

    configure --with-native-debug-symbols=internal
    mv spec.gmk spec.gmk.old
    cat spec.gmk | sed -e 's/[-]O[0-9s]/-O0/g' > spec.gmk

Is there (or should there be) a more elegant way to do it,
like "configure --with-debug-level=slowproduct" :-)

I'm not entirely sure of what you want to achieve.

As I interepret your snippet above, you want no optimization
and internal debug symbols..? How is that debugging a "product"
build?

/Magnus


Thanks
- Ioi











Re: slowproduct build

2018-04-12 Thread Andrew Haley
On 04/10/2018 10:21 PM, Magnus Ihse Bursie wrote:
> So you want to have a way to force -O0 for all compiled files? Something 
> like "bash configure --with-debug-level=release 
> --with-optimization=none", or possibly "make OPTIMIZATION=NONE"?
> 
> Or are you happy with the optimization level of a slowdebug build, and 
> only want to adjust the value of PRODUCT and ASSERT for hotspot to match 
> what's done for a release build? Something like "bash configure 
> --enable-hotspot-product-build"?

I tell you what would be super cool: a way to turn off all of the JIT-
generated assertion code without also turning off ASSERT.  Then you could
read the JIT-generated code in a debug build.  I guess it would be no
more than a matter of finding every #ifdef ASSERT and replacing it with
ASM_ASSERT or somesuch,

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. 
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


Re: slowproduct build

2018-04-10 Thread Ioi Lam



On 4/10/18 2:21 PM, Magnus Ihse Bursie wrote:


On 2018-04-10 23:08, Ioi Lam wrote:

Yes that’s what I want.

Yesterday I was using gdb to step into the interpreter generation 
code to see what’s generated for a particular routine for 
MethodHandles. The debug build contains a LOT of runtime verification 
code in the generated code and I couldn’t figure out what’s 
happening. The product build just generates 10 instructions.
So you want to have a way to force -O0 for all compiled files? 
Something like "bash configure --with-debug-level=release 
--with-optimization=none", or possibly "make OPTIMIZATION=NONE"?



Hi Magnus,

I like the --with-optimization=none flag. This doesn't seem to exist 
yet. Any plans to add it?


The way I would use it is:

    bash configure --with-debug-level=product --with-optimization=none

Thanks
- Ioi

Or are you happy with the optimization level of a slowdebug build, and 
only want to adjust the value of PRODUCT and ASSERT for hotspot to 
match what's done for a release build? Something like "bash configure 
--enable-hotspot-product-build"?


/Magnus



Thanks
Ioi

On Apr 10, 2018, at 1:47 PM, Thomas Stüfe > wrote:


If I understand Ioi correctly, he wants a build with PRODUCT and 
!ASSERT but with debug symbols and no optimizations? So, no 
assertions and all switches with product defaults?


I can see that this could make sense in certain scenarios.

..Thomas

On Tue, Apr 10, 2018 at 10:27 PM, Magnus Ihse Bursie 
> wrote:


On 2018-04-10 02:00, Ioi Lam wrote:

Sometimes I want to debug the product build (I can't bother
with turning off all the trueInDebug options in the hotspot
globals.hpp). The only way that I have found to do this is:

    configure --with-native-debug-symbols=internal
    mv spec.gmk spec.gmk.old
    cat spec.gmk | sed -e 's/[-]O[0-9s]/-O0/g' > spec.gmk

Is there (or should there be) a more elegant way to do it,
like "configure --with-debug-level=slowproduct" :-)

I'm not entirely sure of what you want to achieve.

As I interepret your snippet above, you want no optimization and
internal debug symbols..? How is that debugging a "product" build?

/Magnus


Thanks
- Ioi









Re: slowproduct build

2018-04-10 Thread Magnus Ihse Bursie


On 2018-04-10 23:08, Ioi Lam wrote:

Yes that’s what I want.

Yesterday I was using gdb to step into the interpreter generation code 
to see what’s generated for a particular routine for MethodHandles. 
The debug build contains a LOT of runtime verification code in the 
generated code and I couldn’t figure out what’s happening. The product 
build just generates 10 instructions.
So you want to have a way to force -O0 for all compiled files? Something 
like "bash configure --with-debug-level=release 
--with-optimization=none", or possibly "make OPTIMIZATION=NONE"?


Or are you happy with the optimization level of a slowdebug build, and 
only want to adjust the value of PRODUCT and ASSERT for hotspot to match 
what's done for a release build? Something like "bash configure 
--enable-hotspot-product-build"?


/Magnus



Thanks
Ioi

On Apr 10, 2018, at 1:47 PM, Thomas Stüfe > wrote:


If I understand Ioi correctly, he wants a build with PRODUCT and 
!ASSERT but with debug symbols and no optimizations? So, no 
assertions and all switches with product defaults?


I can see that this could make sense in certain scenarios.

..Thomas

On Tue, Apr 10, 2018 at 10:27 PM, Magnus Ihse Bursie 
> wrote:


On 2018-04-10 02:00, Ioi Lam wrote:

Sometimes I want to debug the product build (I can't bother
with turning off all the trueInDebug options in the hotspot
globals.hpp). The only way that I have found to do this is:

    configure --with-native-debug-symbols=internal
    mv spec.gmk spec.gmk.old
    cat spec.gmk | sed -e 's/[-]O[0-9s]/-O0/g' > spec.gmk

Is there (or should there be) a more elegant way to do it,
like "configure --with-debug-level=slowproduct" :-)

I'm not entirely sure of what you want to achieve.

As I interepret your snippet above, you want no optimization and
internal debug symbols..? How is that debugging a "product" build?

/Magnus


Thanks
- Ioi







Re: slowproduct build

2018-04-10 Thread Ioi Lam
Yes that’s what I want.

Yesterday I was using gdb to step into the interpreter generation code to see 
what’s generated for a particular routine for MethodHandles. The debug build 
contains a LOT of runtime verification code in the generated code and I 
couldn’t figure out what’s happening. The product build just generates 10 
instructions.

Thanks
Ioi

> On Apr 10, 2018, at 1:47 PM, Thomas Stüfe  wrote:
> 
> If I understand Ioi correctly, he wants a build with PRODUCT and !ASSERT but 
> with debug symbols and no optimizations? So, no assertions and all switches 
> with product defaults?
> 
> I can see that this could make sense in certain scenarios.
> 
> ..Thomas
> 
>> On Tue, Apr 10, 2018 at 10:27 PM, Magnus Ihse Bursie 
>>  wrote:
>>> On 2018-04-10 02:00, Ioi Lam wrote:
>>> Sometimes I want to debug the product build (I can't bother with turning 
>>> off all the trueInDebug options in the hotspot globals.hpp). The only way 
>>> that I have found to do this is:
>>> 
>>> configure --with-native-debug-symbols=internal
>>> mv spec.gmk spec.gmk.old
>>> cat spec.gmk | sed -e 's/[-]O[0-9s]/-O0/g' > spec.gmk
>>> 
>>> Is there (or should there be) a more elegant way to do it, like "configure 
>>> --with-debug-level=slowproduct" :-)
>> I'm not entirely sure of what you want to achieve.
>> 
>> As I interepret your snippet above, you want no optimization and internal 
>> debug symbols..? How is that debugging a "product" build?
>> 
>> /Magnus
>> 
>>> 
>>> Thanks
>>> - Ioi
>>> 
>> 
> 


Re: slowproduct build

2018-04-10 Thread Magnus Ihse Bursie

On 2018-04-10 02:00, Ioi Lam wrote:
Sometimes I want to debug the product build (I can't bother with 
turning off all the trueInDebug options in the hotspot globals.hpp). 
The only way that I have found to do this is:


    configure --with-native-debug-symbols=internal
    mv spec.gmk spec.gmk.old
    cat spec.gmk | sed -e 's/[-]O[0-9s]/-O0/g' > spec.gmk

Is there (or should there be) a more elegant way to do it, like 
"configure --with-debug-level=slowproduct" :-)

I'm not entirely sure of what you want to achieve.

As I interepret your snippet above, you want no optimization and 
internal debug symbols..? How is that debugging a "product" build?


/Magnus



Thanks
- Ioi





slowproduct build

2018-04-09 Thread Ioi Lam
Sometimes I want to debug the product build (I can't bother with turning 
off all the trueInDebug options in the hotspot globals.hpp). The only 
way that I have found to do this is:


    configure --with-native-debug-symbols=internal
    mv spec.gmk spec.gmk.old
    cat spec.gmk | sed -e 's/[-]O[0-9s]/-O0/g' > spec.gmk

Is there (or should there be) a more elegant way to do it, like 
"configure --with-debug-level=slowproduct" :-)


Thanks
- Ioi