File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
visualvm/sampler.truffle/src/org/graalvm/visualvm/sampler/truffle Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 25
25
26
26
package org .graalvm .visualvm .sampler .truffle ;
27
27
28
+ import java .util .Properties ;
28
29
import org .graalvm .visualvm .application .Application ;
29
30
import org .graalvm .visualvm .application .jvm .Jvm ;
30
31
import org .graalvm .visualvm .application .jvm .JvmFactory ;
39
40
* @author Jiri Sedlacek
40
41
* @author Tomas Hurka
41
42
*/
42
- public final class SamplerSupport {
43
+ public final class SamplerSupport {
44
+
45
+ private static final String GRAALVM_ID = "GraalVM" ; // NOI18N
43
46
private static SamplerSupport instance ;
44
47
45
48
private ApplicationSamplerViewProvider samplerViewProvider ;
@@ -75,6 +78,15 @@ private SamplerSupport() {
75
78
}
76
79
77
80
private boolean isRunningOnGraalVM (Jvm jvm ) {
78
- return (jvm .getVmName ().contains ("GraalVM" )); // NOI18N
81
+ if (jvm .getVmName ().contains (GRAALVM_ID )) {
82
+ return true ;
83
+ }
84
+ if (jvm .isGetSystemPropertiesSupported ()) {
85
+ Properties props = jvm .getSystemProperties ();
86
+ String vendorVersion = props .getProperty ("java.vendor.version" , "" ); // NOI18N
87
+
88
+ return vendorVersion .contains (GRAALVM_ID );
89
+ }
90
+ return false ;
79
91
}
80
92
}
You can’t perform that action at this time.
0 commit comments