-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redirect logs to stdout in replay mode and introduce deterministic Th…
…readLocalRandom (#35) * Print logs to console in replay mode. * Redirect logs to stdout in replay mode.
- Loading branch information
Showing
10 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...n/kotlin/org/pastalab/fray/instrumentation/base/visitors/ThreadLocalRandomInstrumenter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.pastalab.fray.instrumentation.base.visitors | ||
|
||
import java.util.concurrent.ThreadLocalRandom | ||
import org.objectweb.asm.ClassVisitor | ||
import org.objectweb.asm.MethodVisitor | ||
import org.pastalab.fray.runtime.Runtime | ||
|
||
class ThreadLocalRandomInstrumenter(cv: ClassVisitor) : | ||
ClassVisitorBase(cv, ThreadLocalRandom::class.java.name) { | ||
override fun instrumentMethod( | ||
mv: MethodVisitor, | ||
access: Int, | ||
name: String, | ||
descriptor: String, | ||
signature: String?, | ||
exceptions: Array<out String>? | ||
): MethodVisitor { | ||
if (name == "getProbe") { | ||
return MethodExitVisitor( | ||
mv, | ||
Runtime::onThreadLocalRandomGetProbe, | ||
access, | ||
name, | ||
descriptor, | ||
false, | ||
false, | ||
false, | ||
) | ||
} | ||
return mv | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters