|
@@ -22,6 +22,7 @@ import (
|
|
|
|
|
|
"devt.de/krotik/common/datautil"
|
|
|
"devt.de/krotik/common/errorutil"
|
|
|
+ "devt.de/krotik/ecal/engine/pool"
|
|
|
"devt.de/krotik/ecal/parser"
|
|
|
"devt.de/krotik/ecal/scope"
|
|
|
"devt.de/krotik/ecal/util"
|
|
@@ -44,6 +45,7 @@ type ecalDebugger struct {
|
|
|
lastVisit int64 // Last time the debugger had a state visit
|
|
|
mutexeOwners map[string]uint64 // A map of current mutex owners
|
|
|
mutexLog *datautil.RingBuffer // A log of taken mutexes
|
|
|
+ threadpool *pool.ThreadPool // Reference to the thread pool of the processor
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -109,6 +111,7 @@ func NewECALDebugger(globalVS parser.Scope) util.ECALDebugger {
|
|
|
lastVisit: 0,
|
|
|
mutexeOwners: nil,
|
|
|
mutexLog: nil,
|
|
|
+ threadpool: nil,
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -194,6 +197,15 @@ func (ed *ecalDebugger) SetLockingState(mutexeOwners map[string]uint64, mutexLog
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+SetThreadPool sets the reference to the current used thread pool.
|
|
|
+*/
|
|
|
+func (ed *ecalDebugger) SetThreadPool(tp *pool.ThreadPool) {
|
|
|
+ if ed.threadpool == nil {
|
|
|
+ ed.threadpool = tp
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
VisitState is called for every state during the execution of a program.
|
|
|
*/
|
|
@@ -599,8 +611,9 @@ LockState returns the current locking state.
|
|
|
*/
|
|
|
func (ed *ecalDebugger) LockState() interface{} {
|
|
|
return map[string]interface{}{
|
|
|
- "log": ed.mutexLog.StringSlice(),
|
|
|
- "owners": ed.mutexeOwners,
|
|
|
+ "log": ed.mutexLog.StringSlice(),
|
|
|
+ "owners": ed.mutexeOwners,
|
|
|
+ "threads": ed.threadpool.State(),
|
|
|
}
|
|
|
}
|
|
|
|