From 997b6fb52a713f967e433963341b3bf954d2b282 Mon Sep 17 00:00:00 2001 From: Ao Li Date: Sun, 11 Aug 2024 09:52:12 -0400 Subject: [PATCH] Release 0.1.1 --- build.gradle.kts | 4 +-- core/build.gradle.kts | 10 +++--- .../org/pastalab/fray/core/RunContext.kt | 2 +- .../agent}/build.gradle.kts | 2 +- .../main/kotlin/ApplicationCodeTransformer.kt | 2 +- .../agent}/src/main/kotlin/PreMain.kt | 0 instrumentation/base/build.gradle.kts | 36 +++++++++++++++++++ .../{ => base}/src/main/java/module-info.java | 7 ++-- .../fray/instrumentation/base}/Dummy.java | 2 +- .../fray/instrumentation/base}/Main.kt | 2 +- .../fray/instrumentation/base}/Utils.kt | 2 +- .../base}/memory/VolatileManager.kt | 2 +- .../base}/visitors/AdviceAdapterExtension.kt | 2 +- .../visitors/ArrayOperationInstrumenter.kt | 2 +- .../base}/visitors/AtomicGetInstrumenter.kt | 2 +- .../visitors/AtomicOperationInstrumenter.kt | 2 +- .../visitors/ClassConstructorInstrumenter.kt | 2 +- .../visitors/ClassVersionInstrumenter.kt | 2 +- .../base}/visitors/ClassVisitorBase.kt | 2 +- .../base}/visitors/ConditionInstrumenter.kt | 2 +- .../visitors/CountDownLatchInstrumenter.kt | 2 +- .../FieldInstanceReadWriteInstrumenter.kt | 2 +- .../base}/visitors/LockInstrumenter.kt | 2 +- .../base}/visitors/LockSupportInstrumenter.kt | 2 +- .../base}/visitors/MethodEnterVisitor.kt | 2 +- .../base}/visitors/MethodExitVisitor.kt | 2 +- .../MethodHandleNativesInstrumenter.kt | 2 +- .../base}/visitors/MonitorInstrumenter.kt | 2 +- .../base}/visitors/ObjectInstrumenter.kt | 2 +- .../visitors/ObjectNotifyInstrumenter.kt | 2 +- .../ReentrantReadWriteLockInstrumenter.kt | 2 +- .../base}/visitors/SemaphoreInstrumenter.kt | 2 +- .../base}/visitors/SeparationMethodVisitor.kt | 2 +- .../base}/visitors/SkipMethodInstrumenter.kt | 2 +- .../base}/visitors/SleepInstrumenter.kt | 2 +- .../SynchronizedMethodInstrumenter.kt | 2 +- .../visitors/SystemModulesMapInstrumenter.kt | 2 +- .../base}/visitors/TargetExitInstrumenter.kt | 2 +- .../visitors/ThreadHashCodeInstrumenter.kt | 2 +- .../base}/visitors/ThreadInstrumenter.kt | 2 +- .../base}/visitors/TimeInstrumenter.kt | 2 +- .../base}/visitors/TimedWaitInstrumenter.kt | 2 +- .../base}/visitors/ToStringInstrumenter.kt | 2 +- .../base}/visitors/UnsafeInstrumenter.kt | 2 +- .../instrumentation/base}/visitors/Utils.kt | 2 +- .../visitors/VolatileFieldsInstrumenter.kt | 4 +-- .../src/test/kotlin/visitors/UtilsTest.kt | 2 +- instrumentation/build.gradle.kts | 31 ++-------------- {jdk => instrumentation/jdk}/build.gradle.kts | 10 +++--- .../jdk/src/main/java/module-info.java | 11 ++++++ .../fray/instrumentation/jdk/agent/Dummy.java | 4 +++ .../fray/instrumentation/jdk/jlink/Dummy.java | 4 +++ .../org/pastalab/fray/jdk}/JDKInstrumenter.kt | 4 +-- .../org/pastalab/fray/jdk/agent/Agent.kt | 7 ++-- .../pastalab/fray/jdk/jlink/JlinkPlugin.kt | 8 ++--- jdk/src/main/java/module-info.java | 9 ----- settings.gradle.kts | 6 ++-- 57 files changed, 130 insertions(+), 107 deletions(-) rename {instrumentation-agent => instrumentation/agent}/build.gradle.kts (93%) rename {instrumentation-agent => instrumentation/agent}/src/main/kotlin/ApplicationCodeTransformer.kt (98%) rename {instrumentation-agent => instrumentation/agent}/src/main/kotlin/PreMain.kt (100%) create mode 100644 instrumentation/base/build.gradle.kts rename instrumentation/{ => base}/src/main/java/module-info.java (56%) rename instrumentation/{src/main/java/org/pastalab/fray/instrumentation => base/src/main/java/org/pastalab/fray/instrumentation/base}/Dummy.java (71%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/Main.kt (88%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/Utils.kt (88%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/memory/VolatileManager.kt (96%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/AdviceAdapterExtension.kt (92%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ArrayOperationInstrumenter.kt (98%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/AtomicGetInstrumenter.kt (96%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/AtomicOperationInstrumenter.kt (98%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ClassConstructorInstrumenter.kt (95%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ClassVersionInstrumenter.kt (92%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ClassVisitorBase.kt (96%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ConditionInstrumenter.kt (97%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/CountDownLatchInstrumenter.kt (96%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/FieldInstanceReadWriteInstrumenter.kt (98%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/LockInstrumenter.kt (98%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/LockSupportInstrumenter.kt (96%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/MethodEnterVisitor.kt (94%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/MethodExitVisitor.kt (96%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/MethodHandleNativesInstrumenter.kt (95%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/MonitorInstrumenter.kt (98%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ObjectInstrumenter.kt (97%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ObjectNotifyInstrumenter.kt (98%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ReentrantReadWriteLockInstrumenter.kt (93%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/SemaphoreInstrumenter.kt (98%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/SeparationMethodVisitor.kt (87%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/SkipMethodInstrumenter.kt (96%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/SleepInstrumenter.kt (94%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/SynchronizedMethodInstrumenter.kt (97%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/SystemModulesMapInstrumenter.kt (96%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/TargetExitInstrumenter.kt (95%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ThreadHashCodeInstrumenter.kt (95%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ThreadInstrumenter.kt (98%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/TimeInstrumenter.kt (95%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/TimedWaitInstrumenter.kt (97%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/ToStringInstrumenter.kt (95%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/UnsafeInstrumenter.kt (97%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/Utils.kt (96%) rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => base/src/main/kotlin/org/pastalab/fray/instrumentation/base}/visitors/VolatileFieldsInstrumenter.kt (97%) rename instrumentation/{ => base}/src/test/kotlin/visitors/UtilsTest.kt (90%) rename {jdk => instrumentation/jdk}/build.gradle.kts (79%) create mode 100644 instrumentation/jdk/src/main/java/module-info.java create mode 100644 instrumentation/jdk/src/main/java/org/pastalab/fray/instrumentation/jdk/agent/Dummy.java create mode 100644 instrumentation/jdk/src/main/java/org/pastalab/fray/instrumentation/jdk/jlink/Dummy.java rename instrumentation/{src/main/kotlin/org/pastalab/fray/instrumentation => jdk/src/main/kotlin/org/pastalab/fray/jdk}/JDKInstrumenter.kt (96%) rename {jdk => instrumentation/jdk}/src/main/kotlin/org/pastalab/fray/jdk/agent/Agent.kt (72%) rename {jdk => instrumentation/jdk}/src/main/kotlin/org/pastalab/fray/jdk/jlink/JlinkPlugin.kt (92%) delete mode 100644 jdk/src/main/java/module-info.java diff --git a/build.gradle.kts b/build.gradle.kts index 761575ba..c15129b6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ plugins { allprojects { group = "org.pastalab.fray" - version = "0.1" + version = "0.1.1" } repositories { @@ -43,7 +43,7 @@ configure(allprojects - project(":jvmti")) { } } -configure(allprojects - rootProject) { +configure(allprojects - rootProject - project(":instrumentation")) { plugins.apply("maven-publish") plugins.apply("org.jetbrains.dokka") diff --git a/core/build.gradle.kts b/core/build.gradle.kts index cb4d250f..45bf16d0 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -11,7 +11,7 @@ repositories { dependencies { compileOnly(project(":runtime")) - compileOnly(project(":instrumentation")) + compileOnly(project(":instrumentation:base")) implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1") implementation("com.github.ajalt.clikt:clikt:4.2.2") testImplementation("org.jetbrains.kotlin:kotlin-test") @@ -28,10 +28,10 @@ tasks.named("build") { } tasks.withType { - dependsOn(":jdk:build") - val instrumentationTask = evaluationDependsOn(":instrumentation-agent") + dependsOn(":instrumentation:jdk:build") + val instrumentationTask = evaluationDependsOn(":instrumentation:agent") .tasks.named("shadowJar").get() - val jdk = project(":jdk") + val jdk = project(":instrumentation:jdk") val jvmti = project(":jvmti") val instrumentation = instrumentationTask.outputs.files.first().absolutePath classpath += tasks.named("jar").get().outputs.files + files(configurations.runtimeClasspath) @@ -74,7 +74,7 @@ tasks.register("runFray") { tasks.create("genRunner") { doLast { - val instrumentationTask = evaluationDependsOn(":instrumentation-agent") + val instrumentationTask = evaluationDependsOn(":instrumentation:agent") .tasks.named("shadowJar").get() val instrumentation = instrumentationTask.outputs.files.first().absolutePath val core = tasks.named("jar").get().outputs.files.first().absolutePath diff --git a/core/src/main/kotlin/org/pastalab/fray/core/RunContext.kt b/core/src/main/kotlin/org/pastalab/fray/core/RunContext.kt index 68deeda0..3d8e2f67 100644 --- a/core/src/main/kotlin/org/pastalab/fray/core/RunContext.kt +++ b/core/src/main/kotlin/org/pastalab/fray/core/RunContext.kt @@ -21,7 +21,7 @@ import org.pastalab.fray.core.concurrency.locks.CountDownLatchManager import org.pastalab.fray.core.concurrency.locks.LockManager import org.pastalab.fray.core.concurrency.locks.SemaphoreManager import org.pastalab.fray.core.concurrency.operations.* -import org.pastalab.fray.instrumentation.memory.VolatileManager +import org.pastalab.fray.instrumentation.base.memory.VolatileManager @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") class RunContext(val config: Configuration) { diff --git a/instrumentation-agent/build.gradle.kts b/instrumentation/agent/build.gradle.kts similarity index 93% rename from instrumentation-agent/build.gradle.kts rename to instrumentation/agent/build.gradle.kts index dc12596b..5b5ee869 100644 --- a/instrumentation-agent/build.gradle.kts +++ b/instrumentation/agent/build.gradle.kts @@ -14,7 +14,7 @@ dependencies { add("shadow", gradleApi()) testImplementation(platform("org.junit:junit-bom:5.10.0")) testImplementation("org.junit.jupiter:junit-jupiter") - implementation(project(":instrumentation")) + implementation(project(":instrumentation:base")) } tasks.named("shadowJar") { diff --git a/instrumentation-agent/src/main/kotlin/ApplicationCodeTransformer.kt b/instrumentation/agent/src/main/kotlin/ApplicationCodeTransformer.kt similarity index 98% rename from instrumentation-agent/src/main/kotlin/ApplicationCodeTransformer.kt rename to instrumentation/agent/src/main/kotlin/ApplicationCodeTransformer.kt index 7afed3ce..b17cfaf6 100644 --- a/instrumentation-agent/src/main/kotlin/ApplicationCodeTransformer.kt +++ b/instrumentation/agent/src/main/kotlin/ApplicationCodeTransformer.kt @@ -8,7 +8,7 @@ import org.objectweb.asm.ClassVisitor import org.objectweb.asm.ClassWriter import org.objectweb.asm.Opcodes import org.objectweb.asm.tree.ClassNode -import org.pastalab.fray.instrumentation.visitors.* +import org.pastalab.fray.instrumentation.base.visitors.* class ApplicationCodeTransformer : ClassFileTransformer { override fun transform( diff --git a/instrumentation-agent/src/main/kotlin/PreMain.kt b/instrumentation/agent/src/main/kotlin/PreMain.kt similarity index 100% rename from instrumentation-agent/src/main/kotlin/PreMain.kt rename to instrumentation/agent/src/main/kotlin/PreMain.kt diff --git a/instrumentation/base/build.gradle.kts b/instrumentation/base/build.gradle.kts new file mode 100644 index 00000000..00f8affb --- /dev/null +++ b/instrumentation/base/build.gradle.kts @@ -0,0 +1,36 @@ +plugins { + java + kotlin("jvm") +} + +repositories { + mavenCentral() +} + +dependencies { + testImplementation("org.jetbrains.kotlin:kotlin-test") + implementation("org.jetbrains.kotlin:kotlin-reflect") + api("org.ow2.asm:asm:9.7") + api("org.ow2.asm:asm-tree:9.7") + api("org.ow2.asm:asm-commons:9.7") + api("org.ow2.asm:asm-util:9.7") + implementation(project(":runtime")) +} + +tasks.withType { + jvmArgs("--patch-module", "org.pastalab.fray.instrumentation.base=${sourceSets["main"].output + .asPath}") +} + +tasks.compileJava { + options.compilerArgumentProviders.add(CommandLineArgumentProvider { + // Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work + listOf("--patch-module", "org.pastalab.fray.instrumentation.base=${sourceSets["main"].output + .asPath}") + }) +} + + +tasks.test { + useJUnitPlatform() +} diff --git a/instrumentation/src/main/java/module-info.java b/instrumentation/base/src/main/java/module-info.java similarity index 56% rename from instrumentation/src/main/java/module-info.java rename to instrumentation/base/src/main/java/module-info.java index 97319925..345154c0 100644 --- a/instrumentation/src/main/java/module-info.java +++ b/instrumentation/base/src/main/java/module-info.java @@ -1,6 +1,7 @@ -module org.pastalab.fray.instrumentation { - exports org.pastalab.fray.instrumentation; - opens org.pastalab.fray.instrumentation; +module org.pastalab.fray.instrumentation.base { + exports org.pastalab.fray.instrumentation.base; + exports org.pastalab.fray.instrumentation.base.visitors; + opens org.pastalab.fray.instrumentation.base; requires org.pastalab.fray.runtime; requires kotlin.reflect; requires org.objectweb.asm; diff --git a/instrumentation/src/main/java/org/pastalab/fray/instrumentation/Dummy.java b/instrumentation/base/src/main/java/org/pastalab/fray/instrumentation/base/Dummy.java similarity index 71% rename from instrumentation/src/main/java/org/pastalab/fray/instrumentation/Dummy.java rename to instrumentation/base/src/main/java/org/pastalab/fray/instrumentation/base/Dummy.java index 7c9ba9c8..c15b0084 100644 --- a/instrumentation/src/main/java/org/pastalab/fray/instrumentation/Dummy.java +++ b/instrumentation/base/src/main/java/org/pastalab/fray/instrumentation/base/Dummy.java @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation; +package org.pastalab.fray.instrumentation.base; // We need this dummy class to make sure // the corresponding folders is also created in diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/Main.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/Main.kt similarity index 88% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/Main.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/Main.kt index 3b16b340..107c4526 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/Main.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/Main.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation +package org.pastalab.fray.instrumentation.base import java.io.File diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/Utils.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/Utils.kt similarity index 88% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/Utils.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/Utils.kt index b14e89ad..f998f78f 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/Utils.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/Utils.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation +package org.pastalab.fray.instrumentation.base import java.nio.file.Paths import kotlin.io.path.ExperimentalPathApi diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/memory/VolatileManager.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/memory/VolatileManager.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/memory/VolatileManager.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/memory/VolatileManager.kt index 2e600f9d..b0daae19 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/memory/VolatileManager.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/memory/VolatileManager.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.memory +package org.pastalab.fray.instrumentation.base.memory import java.lang.reflect.Field import java.lang.reflect.Modifier diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/AdviceAdapterExtension.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/AdviceAdapterExtension.kt similarity index 92% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/AdviceAdapterExtension.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/AdviceAdapterExtension.kt index 05c2ebe9..3c55bb58 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/AdviceAdapterExtension.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/AdviceAdapterExtension.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.Opcodes import org.objectweb.asm.Type diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ArrayOperationInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ArrayOperationInstrumenter.kt similarity index 98% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ArrayOperationInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ArrayOperationInstrumenter.kt index a9944dc4..3dac079b 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ArrayOperationInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ArrayOperationInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/AtomicGetInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/AtomicGetInstrumenter.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/AtomicGetInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/AtomicGetInstrumenter.kt index f2557655..7d4069a6 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/AtomicGetInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/AtomicGetInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/AtomicOperationInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/AtomicOperationInstrumenter.kt similarity index 98% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/AtomicOperationInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/AtomicOperationInstrumenter.kt index 38cb3980..db9e6b9c 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/AtomicOperationInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/AtomicOperationInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import java.util.* import java.util.concurrent.atomic.* diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ClassConstructorInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ClassConstructorInstrumenter.kt similarity index 95% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ClassConstructorInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ClassConstructorInstrumenter.kt index 9b634b2d..90393952 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ClassConstructorInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ClassConstructorInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ClassVersionInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ClassVersionInstrumenter.kt similarity index 92% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ClassVersionInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ClassVersionInstrumenter.kt index ead8920c..6c476dcd 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ClassVersionInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ClassVersionInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.Opcodes diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ClassVisitorBase.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ClassVisitorBase.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ClassVisitorBase.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ClassVisitorBase.kt index 804b781c..8b40c990 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ClassVisitorBase.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ClassVisitorBase.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ConditionInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ConditionInstrumenter.kt similarity index 97% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ConditionInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ConditionInstrumenter.kt index f896c5ee..af3f64f8 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ConditionInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ConditionInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject import org.objectweb.asm.ClassVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/CountDownLatchInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/CountDownLatchInstrumenter.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/CountDownLatchInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/CountDownLatchInstrumenter.kt index 690f6293..27a76f71 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/CountDownLatchInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/CountDownLatchInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import java.util.concurrent.CountDownLatch import org.objectweb.asm.ClassVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/FieldInstanceReadWriteInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/FieldInstanceReadWriteInstrumenter.kt similarity index 98% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/FieldInstanceReadWriteInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/FieldInstanceReadWriteInstrumenter.kt index 2da10e5a..0b27c3e1 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/FieldInstanceReadWriteInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/FieldInstanceReadWriteInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/LockInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/LockInstrumenter.kt similarity index 98% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/LockInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/LockInstrumenter.kt index 03a55d0a..89ebb292 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/LockInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/LockInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import java.util.concurrent.locks.ReentrantLock import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/LockSupportInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/LockSupportInstrumenter.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/LockSupportInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/LockSupportInstrumenter.kt index 3702b59e..2b36e0ee 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/LockSupportInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/LockSupportInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import java.util.concurrent.locks.LockSupport import org.objectweb.asm.ClassVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MethodEnterVisitor.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MethodEnterVisitor.kt similarity index 94% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MethodEnterVisitor.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MethodEnterVisitor.kt index 27ba78b9..a085d299 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MethodEnterVisitor.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MethodEnterVisitor.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import kotlin.reflect.KFunction import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MethodExitVisitor.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MethodExitVisitor.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MethodExitVisitor.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MethodExitVisitor.kt index e4392781..d792ca10 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MethodExitVisitor.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MethodExitVisitor.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import kotlin.reflect.KFunction import org.objectweb.asm.Label diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MethodHandleNativesInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MethodHandleNativesInstrumenter.kt similarity index 95% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MethodHandleNativesInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MethodHandleNativesInstrumenter.kt index b4204aa9..82103675 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MethodHandleNativesInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MethodHandleNativesInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MonitorInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MonitorInstrumenter.kt similarity index 98% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MonitorInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MonitorInstrumenter.kt index 22702881..b5f32f3f 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/MonitorInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/MonitorInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.* import org.objectweb.asm.Opcodes.ASM9 diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ObjectInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ObjectInstrumenter.kt similarity index 97% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ObjectInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ObjectInstrumenter.kt index 4f7bcd85..d08902ea 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ObjectInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ObjectInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.Label diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ObjectNotifyInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ObjectNotifyInstrumenter.kt similarity index 98% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ObjectNotifyInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ObjectNotifyInstrumenter.kt index 38ea030c..e8e11807 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ObjectNotifyInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ObjectNotifyInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ReentrantReadWriteLockInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ReentrantReadWriteLockInstrumenter.kt similarity index 93% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ReentrantReadWriteLockInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ReentrantReadWriteLockInstrumenter.kt index 5ff9e142..57d6ef35 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ReentrantReadWriteLockInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ReentrantReadWriteLockInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import java.util.concurrent.locks.ReentrantReadWriteLock import org.objectweb.asm.ClassVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SemaphoreInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SemaphoreInstrumenter.kt similarity index 98% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SemaphoreInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SemaphoreInstrumenter.kt index b02595b2..2833e882 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SemaphoreInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SemaphoreInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import java.util.concurrent.Semaphore import org.objectweb.asm.ClassVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SeparationMethodVisitor.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SeparationMethodVisitor.kt similarity index 87% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SeparationMethodVisitor.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SeparationMethodVisitor.kt index ec7eb7dd..d30c4845 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SeparationMethodVisitor.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SeparationMethodVisitor.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.AnnotationVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SkipMethodInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SkipMethodInstrumenter.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SkipMethodInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SkipMethodInstrumenter.kt index 60cfb48b..c5618d28 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SkipMethodInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SkipMethodInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import java.io.PrintStream import java.lang.invoke.CallSite diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SleepInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SleepInstrumenter.kt similarity index 94% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SleepInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SleepInstrumenter.kt index 7ff36f5f..b46b3a6b 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SleepInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SleepInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SynchronizedMethodInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SynchronizedMethodInstrumenter.kt similarity index 97% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SynchronizedMethodInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SynchronizedMethodInstrumenter.kt index 7fccf4b3..ddef687e 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SynchronizedMethodInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SynchronizedMethodInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.* import org.objectweb.asm.Opcodes.ASM9 diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SystemModulesMapInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SystemModulesMapInstrumenter.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SystemModulesMapInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SystemModulesMapInstrumenter.kt index a5c0838b..7def69c5 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/SystemModulesMapInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/SystemModulesMapInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/TargetExitInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/TargetExitInstrumenter.kt similarity index 95% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/TargetExitInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/TargetExitInstrumenter.kt index ede3716f..4f3cbc0c 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/TargetExitInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/TargetExitInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ThreadHashCodeInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ThreadHashCodeInstrumenter.kt similarity index 95% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ThreadHashCodeInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ThreadHashCodeInstrumenter.kt index 12c219a7..1227c2ec 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ThreadHashCodeInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ThreadHashCodeInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ThreadInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ThreadInstrumenter.kt similarity index 98% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ThreadInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ThreadInstrumenter.kt index c962c093..2190600b 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ThreadInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ThreadInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/TimeInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/TimeInstrumenter.kt similarity index 95% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/TimeInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/TimeInstrumenter.kt index ec7074b9..662eda69 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/TimeInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/TimeInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/TimedWaitInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/TimedWaitInstrumenter.kt similarity index 97% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/TimedWaitInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/TimedWaitInstrumenter.kt index e92a5bee..9d152ec1 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/TimedWaitInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/TimedWaitInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import kotlin.reflect.KFunction import org.objectweb.asm.ClassVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ToStringInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ToStringInstrumenter.kt similarity index 95% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ToStringInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ToStringInstrumenter.kt index 008baff0..5cb9482e 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/ToStringInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/ToStringInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/UnsafeInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/UnsafeInstrumenter.kt similarity index 97% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/UnsafeInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/UnsafeInstrumenter.kt index b0a6845a..9833e249 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/UnsafeInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/UnsafeInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.MethodVisitor diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/Utils.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/Utils.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/Utils.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/Utils.kt index a543af70..4302f43d 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/Utils.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/Utils.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import kotlin.reflect.KFunction import kotlin.reflect.javaType diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/VolatileFieldsInstrumenter.kt b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/VolatileFieldsInstrumenter.kt similarity index 97% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/VolatileFieldsInstrumenter.kt rename to instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/VolatileFieldsInstrumenter.kt index bcc1bbd2..96ef3202 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/visitors/VolatileFieldsInstrumenter.kt +++ b/instrumentation/base/src/main/kotlin/org/pastalab/fray/instrumentation/base/visitors/VolatileFieldsInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation.visitors +package org.pastalab.fray.instrumentation.base.visitors import org.objectweb.asm.ClassVisitor import org.objectweb.asm.FieldVisitor @@ -6,7 +6,7 @@ import org.objectweb.asm.MethodVisitor import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes.ASM9 import org.objectweb.asm.commons.AdviceAdapter -import org.pastalab.fray.instrumentation.memory.VolatileManager +import org.pastalab.fray.instrumentation.base.memory.VolatileManager class VolatileFieldsInstrumenter(cv: ClassVisitor, private val instrumentingJdk: Boolean) : ClassVisitor(ASM9, cv) { diff --git a/instrumentation/src/test/kotlin/visitors/UtilsTest.kt b/instrumentation/base/src/test/kotlin/visitors/UtilsTest.kt similarity index 90% rename from instrumentation/src/test/kotlin/visitors/UtilsTest.kt rename to instrumentation/base/src/test/kotlin/visitors/UtilsTest.kt index 19913d9f..edbc6f8d 100644 --- a/instrumentation/src/test/kotlin/visitors/UtilsTest.kt +++ b/instrumentation/base/src/test/kotlin/visitors/UtilsTest.kt @@ -2,7 +2,7 @@ package visitors import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test -import org.pastalab.fray.instrumentation.visitors.Utils +import org.pastalab.fray.instrumentation.base.visitors.Utils fun exampleMethod(param1: String, param2: Int): Long = 42L diff --git a/instrumentation/build.gradle.kts b/instrumentation/build.gradle.kts index 2a14dfa8..10aad1c0 100644 --- a/instrumentation/build.gradle.kts +++ b/instrumentation/build.gradle.kts @@ -1,34 +1,7 @@ plugins { java - kotlin("jvm") } -repositories { - mavenCentral() -} - -dependencies { - testImplementation("org.jetbrains.kotlin:kotlin-test") - implementation("org.jetbrains.kotlin:kotlin-reflect") - api("org.ow2.asm:asm:9.7") - api("org.ow2.asm:asm-tree:9.7") - api("org.ow2.asm:asm-commons:9.7") - api("org.ow2.asm:asm-util:9.7") - implementation(project(":runtime")) -} - -tasks.withType { - jvmArgs("--patch-module", "org.pastalab.fray.instrumentation=${sourceSets["main"].output.asPath}") -} - -tasks.compileJava { - options.compilerArgumentProviders.add(CommandLineArgumentProvider { - // Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work - listOf("--patch-module", "org.pastalab.fray.instrumentation=${sourceSets["main"].output.asPath}") - }) -} - - -tasks.test { - useJUnitPlatform() +subprojects { + group = "org.pastalab.fray.instrumentation" } diff --git a/jdk/build.gradle.kts b/instrumentation/jdk/build.gradle.kts similarity index 79% rename from jdk/build.gradle.kts rename to instrumentation/jdk/build.gradle.kts index 165e0503..a75fdc8d 100644 --- a/jdk/build.gradle.kts +++ b/instrumentation/jdk/build.gradle.kts @@ -10,7 +10,7 @@ repositories { dependencies { testImplementation("org.jetbrains.kotlin:kotlin-test") implementation(project(":runtime")) - implementation(project(":instrumentation")) + implementation(project(":instrumentation:base")) } tasks.test { @@ -20,13 +20,14 @@ tasks.test { tasks.compileJava { options.compilerArgumentProviders.add(CommandLineArgumentProvider { // Provide compiled Kotlin classes to javac – needed for Java/Kotlin mixed sources to work - listOf("--patch-module", "org.pastalab.fray.jdk=${sourceSets["main"].output.asPath}") + listOf("--patch-module", "org.pastalab.fray.instrumentation.jdk=${sourceSets["main"].output + .asPath}") }) } tasks.jar { manifest { - attributes(mapOf("Premain-Class" to "org.pastalab.fray.jdk.agent.AgentKt")) + attributes(mapOf("Premain-Class" to "org.pastalab.fray.instrumentation.jdk.agent.AgentKt")) } dependsOn("copyDependencies") } @@ -50,7 +51,8 @@ tasks.build { ?.joinToString(separator = ":") { it.absolutePath } ?: "No JAR files found." val command = listOf("jlink", "-J-javaagent:$runtimeJar", "-J--module-path=$jars:$runtimeJar", - "-J--add-modules=org.pastalab.fray.jdk", "-J--class-path=$jars:$runtimeJar", + "-J--add-modules=org.pastalab.fray.instrumentation.jdk", + "-J--class-path=$jars:$runtimeJar", "--output=$jdkPath", "--add-modules=ALL-MODULE-PATH", "--fray-instrumentation") println(command.joinToString(" ")) commandLine(command) diff --git a/instrumentation/jdk/src/main/java/module-info.java b/instrumentation/jdk/src/main/java/module-info.java new file mode 100644 index 00000000..2faf59af --- /dev/null +++ b/instrumentation/jdk/src/main/java/module-info.java @@ -0,0 +1,11 @@ +module org.pastalab.fray.instrumentation.jdk { + requires jdk.jlink; + requires java.instrument; + requires kotlin.stdlib; + requires org.pastalab.fray.instrumentation.base; + requires org.pastalab.fray.runtime; + requires org.objectweb.asm.commons; + requires org.objectweb.asm.util; + exports org.pastalab.fray.instrumentation.jdk.agent; + exports org.pastalab.fray.instrumentation.jdk.jlink; +} \ No newline at end of file diff --git a/instrumentation/jdk/src/main/java/org/pastalab/fray/instrumentation/jdk/agent/Dummy.java b/instrumentation/jdk/src/main/java/org/pastalab/fray/instrumentation/jdk/agent/Dummy.java new file mode 100644 index 00000000..e88a5f68 --- /dev/null +++ b/instrumentation/jdk/src/main/java/org/pastalab/fray/instrumentation/jdk/agent/Dummy.java @@ -0,0 +1,4 @@ +package org.pastalab.fray.instrumentation.jdk.agent; + +public class Dummy { +} diff --git a/instrumentation/jdk/src/main/java/org/pastalab/fray/instrumentation/jdk/jlink/Dummy.java b/instrumentation/jdk/src/main/java/org/pastalab/fray/instrumentation/jdk/jlink/Dummy.java new file mode 100644 index 00000000..4224116d --- /dev/null +++ b/instrumentation/jdk/src/main/java/org/pastalab/fray/instrumentation/jdk/jlink/Dummy.java @@ -0,0 +1,4 @@ +package org.pastalab.fray.instrumentation.jdk.jlink; + +public class Dummy { +} diff --git a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/JDKInstrumenter.kt b/instrumentation/jdk/src/main/kotlin/org/pastalab/fray/jdk/JDKInstrumenter.kt similarity index 96% rename from instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/JDKInstrumenter.kt rename to instrumentation/jdk/src/main/kotlin/org/pastalab/fray/jdk/JDKInstrumenter.kt index ed7aafdb..70956dc0 100644 --- a/instrumentation/src/main/kotlin/org/pastalab/fray/instrumentation/JDKInstrumenter.kt +++ b/instrumentation/jdk/src/main/kotlin/org/pastalab/fray/jdk/JDKInstrumenter.kt @@ -1,4 +1,4 @@ -package org.pastalab.fray.instrumentation +package org.pastalab.fray.jdk import java.io.File import java.io.InputStream @@ -11,7 +11,7 @@ import org.objectweb.asm.commons.ModuleTargetAttribute import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ModuleExportNode import org.objectweb.asm.util.CheckClassAdapter -import org.pastalab.fray.instrumentation.visitors.* +import org.pastalab.fray.instrumentation.base.visitors.* fun instrumentClass(path: String, inputStream: InputStream): ByteArray { val byteArray = inputStream.readBytes() diff --git a/jdk/src/main/kotlin/org/pastalab/fray/jdk/agent/Agent.kt b/instrumentation/jdk/src/main/kotlin/org/pastalab/fray/jdk/agent/Agent.kt similarity index 72% rename from jdk/src/main/kotlin/org/pastalab/fray/jdk/agent/Agent.kt rename to instrumentation/jdk/src/main/kotlin/org/pastalab/fray/jdk/agent/Agent.kt index 68e6595d..9b44bc78 100644 --- a/jdk/src/main/kotlin/org/pastalab/fray/jdk/agent/Agent.kt +++ b/instrumentation/jdk/src/main/kotlin/org/pastalab/fray/jdk/agent/Agent.kt @@ -1,11 +1,11 @@ -package org.pastalab.fray.jdk.agent +package org.pastalab.fray.instrumentation.jdk.agent import java.lang.instrument.Instrumentation import java.util.* fun premain(arguments: String?, instrumentation: Instrumentation) { val jlinkModule = ModuleLayer.boot().findModule("jdk.jlink").get() - val fray = ModuleLayer.boot().findModule("org.pastalab.fray.jdk").get() + val fray = ModuleLayer.boot().findModule("org.pastalab.fray.instrumentation.jdk").get() val extraExports = mapOf("jdk.tools.jlink.plugin" to Collections.singleton(fray)) @@ -13,7 +13,8 @@ fun premain(arguments: String?, instrumentation: Instrumentation) { jlinkModule, emptySet(), extraExports, emptyMap(), emptySet(), emptyMap()) val pluginClass = jlinkModule.classLoader.loadClass("jdk.tools.jlink.plugin.Plugin") - val frayPlugin = fray.classLoader.loadClass("org.pastalab.fray.jdk.jlink.JlinkPlugin") + val frayPlugin = + fray.classLoader.loadClass("org.pastalab.fray.instrumentation.jdk.jlink.JlinkPlugin") val extraProvides = mapOf(pluginClass to listOf(frayPlugin)) diff --git a/jdk/src/main/kotlin/org/pastalab/fray/jdk/jlink/JlinkPlugin.kt b/instrumentation/jdk/src/main/kotlin/org/pastalab/fray/jdk/jlink/JlinkPlugin.kt similarity index 92% rename from jdk/src/main/kotlin/org/pastalab/fray/jdk/jlink/JlinkPlugin.kt rename to instrumentation/jdk/src/main/kotlin/org/pastalab/fray/jdk/jlink/JlinkPlugin.kt index 35e73018..76491ebe 100644 --- a/jdk/src/main/kotlin/org/pastalab/fray/jdk/jlink/JlinkPlugin.kt +++ b/instrumentation/jdk/src/main/kotlin/org/pastalab/fray/jdk/jlink/JlinkPlugin.kt @@ -1,6 +1,6 @@ @file:Suppress("JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE") -package org.pastalab.fray.jdk.jlink +package org.pastalab.fray.instrumentation.jdk.jlink import java.io.File import java.util.zip.ZipFile @@ -8,9 +8,9 @@ import jdk.tools.jlink.plugin.Plugin import jdk.tools.jlink.plugin.ResourcePool import jdk.tools.jlink.plugin.ResourcePoolBuilder import jdk.tools.jlink.plugin.ResourcePoolEntry -import org.pastalab.fray.instrumentation.Utils -import org.pastalab.fray.instrumentation.instrumentClass -import org.pastalab.fray.instrumentation.instrumentModuleInfo +import org.pastalab.fray.instrumentation.base.Utils +import org.pastalab.fray.jdk.instrumentClass +import org.pastalab.fray.jdk.instrumentModuleInfo class JlinkPlugin : Plugin { override fun getName(): String { diff --git a/jdk/src/main/java/module-info.java b/jdk/src/main/java/module-info.java deleted file mode 100644 index 0c1256af..00000000 --- a/jdk/src/main/java/module-info.java +++ /dev/null @@ -1,9 +0,0 @@ -module org.pastalab.fray.jdk { - requires jdk.jlink; - requires java.instrument; - requires kotlin.stdlib; - requires org.pastalab.fray.instrumentation; - requires org.pastalab.fray.runtime; - exports org.pastalab.fray.jdk.agent; - exports org.pastalab.fray.jdk.jlink; -} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index e41f05e3..a201e7b5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,10 +8,10 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" } rootProject.name = "fray" -include("jdk") include("runtime") include("jvmti") include("core") -include("instrumentation") include("junit") -include("instrumentation-agent") +include("instrumentation:base") +include("instrumentation:agent") +include("instrumentation:jdk")