in jvm-agent/src/main/org/jetbrains/lincheck/jvm/agent/LincheckClassFileTransformer.kt [388:405]
fun shouldTransform(className: String, instrumentationMode: InstrumentationMode): Boolean {
// In the stress testing mode, we can simply skip the standard
// Java and Kotlin classes -- they do not have coroutine suspension points.
if (instrumentationMode == STRESS) {
if (className.startsWith("java.") || className.startsWith("kotlin.")) return false
}
if (instrumentationMode == TRACE_RECORDING) {
if (className == "java.lang.Thread") return true
if (className.startsWith("kotlin.concurrent.ThreadsKt")) return true
if (className.startsWith("java.") || className.startsWith("kotlin.") || className.startsWith("jdk.")) return false
// there is a bug with instrumentation of android tools classes,
// see https://youtrack.jetbrains.com/issue/JBRes-7051
if (className.startsWith("com.android.tools.")) return false
}
if (isEagerlyInstrumentedClass(className)) return true
return AnalysisProfile.DEFAULT.shouldTransform(className, "")
}