ghc-trace-events-0.1.2.8: Faster traceEvent and traceMarker, and binary object logging for eventlog
Safe HaskellSafe-Inferred
LanguageHaskell2010

Debug.Trace.Binary

Description

Arbitary binary object logging available for GHC 8.8 or later. Unlike the other tracing functions traceBinaryEvent takes an arbitrary ByteString object as opposed to a UTF-8 encoded string.

Synopsis

Binary eventlog tracing

traceBinaryEvent :: ByteString -> a -> a Source #

The traceBinaryEvent function behaves like traceEvent but with the difference that the message is a binary object rather than a UTF-8 encoded string.

It is suitable for use in pure code. In an IO context use traceBinaryEventIO instead.

Note that when using GHC's SMP runtime, it is possible (but rare) to get duplicate events emitted if two CPUs simultaneously evaluate the same thunk that uses traceBinaryEvent.

Also note that this function doesn't evaluate the ByteString if user tracing in evnetlog is disabled.

The input should be shorter than \(2^{16}\) bytes. Otherwise the RTS generates a broken eventlog.

traceBinaryEventIO :: ByteString -> IO () Source #

The traceBinaryEventIO function emits a binary message to the eventlog, if eventlog profiling is available and enabled at runtime.

Compared to traceBinaryEvent, traceBinaryEventIO sequences the event with respect to other IO actions.

Also note that this function doesn't evaluate the ByteString if user tracing in evnetlog is disabled.

The input should be shorter than \(2^{16}\) bytes. Otherwise the RTS generates a broken eventlog.