úÎX TZ$      !"#None24M)$1Simple channels that don't support real blocking.%The state for an exponential backoff.%Maximum nanoseconds to wait.ßWe allow logging in O(1) time in String or ByteString format. In practice the distinction is not that important, because only *thunks* should be logged; the thread printing the logs should deal with forcing those thunks.ŠThis sort of message is chatter and NOT meant to participate in the scheduler-testing framework. | ByteStrMsg { lvl::Int, }cSeveral different ways we know to wait for quiescence in the concurrent mutator before proceeding. æIn this mode, logging calls are non-blocking and return immediately, rather than waiting on a central coordinator. This is what we want if we're simply printing debugging output, not controlling the schedule for stress testing. BA fixed set of threads must check-in each round before proceeding. %How many threads total must check in? ¨Poll how many threads WON'T participate this round. After all *productive* threads have checked in this number must grow to eventually include all other threads. fUNFINISHED: Dynamically track tasks/workers. The num workers starts at 1 and then is modified with & and '.(aA single thread attempting to log a message. It only unblocks when the attached MVar is filled.HA Logger coordinates a set of threads that print debug logging messages.|This are abstract objects supporting only the operations provided by this module and the non-hidden fields of the Logger.)k(private) The thread that chooses which action to unblock next and handles printing to the screen as well.BThe minimum level of messages accepted by this logger (usually 0).6The maximum level of messages accepted by this logger.*?The serialized queue of writers attempting to log dbg messages.](public) A method to complete flushing, close down the helper thread, and generally wrap up.+;Where to send output. If empty, messages dropped entirely.,‚(private) In-memory buffer of messages, if OutputInMemory is selected. This is stored in reverse-temporal order during execution.BClear buffered log messages and return in the order they occurred.:DebugConfig: what level of debugging support is activated?ùInclusive range of debug messages to accept (i.e. filter on priority level). If Nothing, use the default level, which is (0,N) where N is controlled by the DEBUG environment variable. The convention is to use Just (0,0) to disable logging.$Destinations for debug log messages.jIn additional to logging debug messages, control thread interleaving at these points when this is True.A destination for log messages7Accumulate output in memory and flush when appropriate.*Printed human-readable output to a handle.Output via GHC's  traceEvent runtime events.•Create a new logger, which includes forking a coordinator thread. Takes as argument the number of worker threads participating in the computation.-wRun a logging coordinator thread until completion/shutdown. This coordinator manages the interleaving of events that . $Undocumented, internal functionalityWSuppress echo'ing of messages that don't actually count for the schedule fuzz testing.uWrite a log message from the current thread, IF the level of the message falls into the range accepted by the given %, otherwise, the message is ignored.6Create an object used for exponentential backoff; see  . 2Perform the backoff, possibly delaying the thread./Non-blocking read.0KA synchronous read that must block or busy-wait until a value is available.10Always succeeds. Asynchronous write to channel.!cDebugging flag shared by several modules. This is activated by setting the environment variable  DEBUG=1..5.By convention  DEBUG=100£ turns on full sequentialization of the program and control over the interleavings in concurrent code, enabling systematic debugging of concurrency problems."¹This codifies the convention of keeping fine-grained pre-each-memory-modification messages at higher debug levels. These are used for fuzz testing concurrent interleavings. Setting  in the Y to this value should give you only the messages necessary for stress testing schedules.#1Exceptions that walk up the fork-tree of threads.åWARNING: By holding onto the ThreadId we keep the parent thread from being garbage collected (at least as of GHC 7.6). This means that even if it was complete, it will still be hanging around to accept the exception below.H$23% (45678)*+,9:;<=IWhat inclusive range of messages do we accept? Defaults to `(0,dbgLvl)`.%Where do we write debugging messages?iDo we wait for workers before proceeding sequentially but randomly (fuzz testing event interleavings)?-6By which method do we wait for all workers to quiesce?WSet to True (by someone other than the coordinator) when the system should shutdown.5Input queue where the coordinator recvs dbg messages 6Output queue where the coordinator writes out messagesWhere to write log messages>.?@&'AMaximum delay, nanoseconds B/01C!"DE#FG$  !"#%!" # %$23% (4567 8)*+,9:;<=->.?@&'A B/01C!"DE#FGH      !"#$%&'()*+,-./0123)456789:;<=>?@ABCDEFtslogger-0.1.0.0System.Log.TSLoggerBackoff totalWaitLogMsg OffTheRecordobodStrMsglvlbodyWaitModeDontWaitWaitNum numThreads downThreads WaitDynamicLoggerminLvlmaxLvlcloseIt flushLogsDbgCfgdbgRangedbgDests dbgSchedulingOutDestOutputInMemoryOutputTo OutputEventsmapMsg newLoggerlogOn newBackoffbackoffdbgLvldefaultMemDbgRangeforkWithExceptionsSmplChancap incrTasks decrTasksWriter coordinator checkPoint loutDestsloggedrunCoordinatorsilenceOffTheRecordtryReadSmplChan readSmplChan writeSmplChancurrentwhocontinuemsg waitWorkerstoStringmaxWaitandMcatchAllisOffTheRecordchatter printNTrace dummyMVar newSmplChantheEnv defaultDbg replayDbg$fShowIO $fShowIO0