[8u] RFR 8233197: Invert JvmtiExport::post_vm_initialized() and Jfr:on_vm_start() start-up order for correct option parsing
Andrew Haley
aph at redhat.com
Wed Jun 10 13:14:54 UTC 2020
On 10/06/2020 13:31, Jaroslav Bachorík wrote:
>> ISTM that this code is run unconditionally if INCLUDE_JFR is set at compile
>> time. Am I misunderstanding something?
>
> Ok. I misunderstood the original request. I thought it was supposed to
> be in-line with other JFR specific changes which are guarded with
> compile-time conditional blocks.
>
>> If this is not true, and the initialize_class only runs if JFR is
>> enabled, how does that work?
>
> This thing you ask (runtime check for whether JFR is enabled) is
> impossible at that place, AFAIK. The affected code is in 'create_vm'
> block so JVM is not really alive. Checking the JFR enabled status
> requires parsing JFR configs which happens to be done in Java and that
> requires java.lang.Class to be already linked and initialized - making
> it impossible to check the JFR enablement status before initializing
> java.lang.Class.
So, then, I take it that the JFR configs are always opened and run,
regardless of whether JFR is in use, in order to determine whether JFR
is in use? Please point me to the code that does this.
--
Andrew Haley (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671
More information about the jdk8u-dev
mailing list