-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Feature request
Enable the use of Java Flight Recorder (JFR) to profile the native image driver itself, i.e. by passing -J-XX:StartFlightRecording
to native-image
.
Is your feature request related to a problem? Please describe.
Being able to profile and better understand what's happening during native-image generation is a key prerequisite in optimizing it.
Describe the solution you'd like.
We should be able to pass -J-XX:StartFlightRecording
to native-image
and enable profiling of the native image driver on the host VM, this however should not impact the code being compiled to native image.
Ideally passing -J-XX:StartFlightRecording
to native-image
should also be compatible with -H:+AllowVMInspection
.
Describe who do you think will benefit the most.
GraalVM contributors.
Additional context.
The issues observed that far are:
- Passing
-J-XX:StartFlightRecording
alters the behavior of the code being compiled bynative-image
, e.g.java.lang.Error.<init>
is being compiled with embed JFR instrumentation calls while an instrumentedjava.lang.Error.<init>
should only be used on the host JVM. - Passing
-J-XX:StartFlightRecording
results in various JFR-related classes being initialized and embed in the image heap. This not only results in larger image sizes but also breaks JFR support in the generated native image since various elements of JFR get preconfigured at build-time.
Express whether you'd like to help contributing this feature
Yes