Created
December 17, 2015 14:36
-
-
Save drewhk/7c2c14c87cdb7c691751 to your computer and use it in GitHub Desktop.
Deadlock dumper
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
def dumpwaits(): Unit = { | |
println("digraph waits {") | |
for (i ← assembly.stages.indices) { | |
println(s"""N$i [label="${assembly.stages(i)}"]""") | |
} | |
for (i ← portStates.indices) { | |
portStates(i) match { | |
case InReady ⇒ | |
println(s""" N${assembly.inOwners(i)} -> N${assembly.outOwners(i)} [label="shouldPull"]; """) | |
case OutReady ⇒ | |
println(s""" N${assembly.outOwners(i)} -> N${assembly.inOwners(i)} [label="shouldPush"]; """) | |
case _ ⇒ | |
println(s""" N${assembly.inOwners(i)} -> N${assembly.outOwners(i)} [style=dotted; label="closed" dir=both]; """) | |
} | |
} | |
println("}") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment