File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 55
55
import com .oracle .svm .core .option .SubstrateOptionsParser ;
56
56
import com .oracle .svm .core .posix .headers .Signal ;
57
57
import com .oracle .svm .core .posix .linux .LinuxSubstrateSigprofHandler ;
58
+ import com .oracle .svm .core .sampler .ProfilingSampler ;
58
59
import com .oracle .svm .core .sampler .SubstrateSigprofHandler ;
59
60
import com .oracle .svm .core .thread .ThreadListenerSupport ;
60
61
import com .oracle .svm .core .thread .ThreadListenerSupportFeature ;
@@ -141,7 +142,7 @@ public List<Class<? extends Feature>> getRequiredFeatures() {
141
142
142
143
@ Override
143
144
public void afterRegistration (AfterRegistrationAccess access ) {
144
- if (JfrExecutionSamplerSupported .isSupported () && isSignalHandlerBasedExecutionSamplerEnabled ()) {
145
+ if (JfrExecutionSamplerSupported .isSupported () && isSignalHandlerBasedExecutionSamplerEnabled () && useAsyncSampler () ) {
145
146
SubstrateSigprofHandler sampler = makeNewSigprofHandler ();
146
147
ImageSingletons .add (JfrExecutionSampler .class , sampler );
147
148
ImageSingletons .add (SubstrateSigprofHandler .class , sampler );
@@ -151,6 +152,10 @@ public void afterRegistration(AfterRegistrationAccess access) {
151
152
}
152
153
}
153
154
155
+ private static boolean useAsyncSampler () {
156
+ return !ImageSingletons .contains (ProfilingSampler .class ) || ImageSingletons .lookup (ProfilingSampler .class ).isAsyncSampler ();
157
+ }
158
+
154
159
private static SubstrateSigprofHandler makeNewSigprofHandler () {
155
160
/*
156
161
* For JFR, we should employ a global timer instead of a per-thread timer to adhere to the
You can’t perform that action at this time.
0 commit comments