Skip to content

Commit 8d5c417

Browse files
committed
io-sim-por: added EventSimStart
It is useful when analysing 'IOSimPOR' logs to know when each simulation starts.
1 parent 2091a97 commit 8d5c417

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

io-sim/src/Control/Monad/IOSim/Types.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,8 @@ pattern TraceLoop = Trace.Nil Loop
673673

674674

675675
data SimEventType
676-
= EventSay String
676+
= EventSimStart ScheduleControl
677+
| EventSay String
677678
| EventLog Dynamic
678679
| EventMask MaskingState
679680

io-sim/src/Control/Monad/IOSimPOR/Internal.hs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -974,10 +974,15 @@ runSimTraceST mainAction = controlSimTraceST Nothing ControlDefault mainAction
974974

975975
controlSimTraceST :: Maybe Int -> ScheduleControl -> IOSim s a -> ST s (SimTrace a)
976976
controlSimTraceST limit control mainAction =
977-
schedule mainThread initialState { control = control,
978-
control0 = control,
979-
perStepTimeLimit = limit
980-
}
977+
SimTrace (curTime initialState)
978+
(threadId mainThread)
979+
0
980+
(threadLabel mainThread)
981+
(EventSimStart control)
982+
<$> schedule mainThread initialState { control = control,
983+
control0 = control,
984+
perStepTimeLimit = limit
985+
}
981986
where
982987
mainThread =
983988
Thread {

0 commit comments

Comments
 (0)