RFR(M): 8182651: Add TRACE_ONLY conditional macro to support more fine-grained INCLUDE_TRACE programming

Stefan Karlsson stefan.karlsson at oracle.com
Thu Jun 22 07:00:11 UTC 2017


Hi Markus,

I opened the first file in this patch and saw that it didn't explicitly 
include macros.hpp. That is risky, and all checks for the INCLUDE_ 
defines need to be preceded with an include to macros.hpp.

Otherwise, you run the risk of not compiling code inside blocks like:
#if INCLUDE_TRACE
// do stuff
#endif

even though compilation of trace code is enabled.

Thanks,
StefanK

On 2017-06-21 20:44, Markus Gronlund wrote:
> Greetings,
> 
>   
> 
> This is a follow-up suggestion to an earlier discussion [1] regarding the conditional vs. unconditional use of trace-related code in general.
> 
>   
> 
> Webrev: http://cr.openjdk.java.net/~mgronlun/8182651/webrev01/
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8182651
> 
>   
> 
> This will introduce the TRACE_ONLY macro to better handle conditional compilation as well as giving some more flexibility to the ways of working with events in the VM.
> 
>   
> 
> Thanks
> 
> Markus
> 
>   
> 
> [1]
> 
> http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2017-May/023328.html
> 
>   
> 


More information about the hotspot-runtime-dev mailing list