in oap-server/server-library/library-async-profiler-jfr-parser/src/main/java/org/apache/skywalking/oap/server/library/jfr/type/Classifier.java [107:150]
private Category detectOther(long[] methods, byte[] types) {
boolean inJava = true;
for (int i = 0; i < types.length; i++) {
switch (types[i]) {
case TYPE_INTERPRETED:
return inJava ? Category.INTERPRETER : Category.NATIVE;
case TYPE_JIT_COMPILED:
return inJava ? Category.C2_COMP : Category.NATIVE;
case TYPE_INLINED:
inJava = true;
break;
case TYPE_NATIVE: {
String methodName = getMethodName(methods[i], types[i]);
if (methodName.startsWith("JVM_") || methodName.startsWith("Unsafe_") ||
methodName.startsWith("MHN_") || methodName.startsWith("jni_")) {
return Category.VM;
}
switch (methodName) {
case "call_stub":
case "deoptimization":
case "unknown_Java":
case "not_walkable_Java":
case "InlineCacheBuffer":
return Category.VM;
}
if (methodName.endsWith("_arraycopy") || methodName.contains("pthread_cond")) {
break;
}
inJava = false;
break;
}
case TYPE_CPP: {
String methodName = getMethodName(methods[i], types[i]);
if (methodName.startsWith("Runtime1::")) {
return Category.C1_COMP;
}
break;
}
case TYPE_C1_COMPILED:
return inJava ? Category.C1_COMP : Category.NATIVE;
}
}
return Category.NATIVE;
}