- Haskell 54%
- C 46%
|
Teo Camarasu
4e32669bdc
All checks were successful
ci/woodpecker/tag/woodpecker/5 Pipeline was successful
ci/woodpecker/tag/woodpecker/2 Pipeline was successful
ci/woodpecker/tag/woodpecker/1 Pipeline was successful
ci/woodpecker/tag/woodpecker/6 Pipeline was successful
ci/woodpecker/tag/woodpecker/4 Pipeline was successful
ci/woodpecker/tag/woodpecker/3 Pipeline was successful
ci/woodpecker/push/woodpecker/3 Pipeline was successful
ci/woodpecker/push/woodpecker/5 Pipeline was successful
ci/woodpecker/push/woodpecker/4 Pipeline was successful
ci/woodpecker/push/woodpecker/2 Pipeline was successful
ci/woodpecker/push/woodpecker/6 Pipeline was successful
ci/woodpecker/push/woodpecker/1 Pipeline was successful
|
||
|---|---|---|
| cbits | Add stopLoopbackWriter | |
| src/GHC/RTS/Events | Resolve warning | |
| test | Split out readEventLogChunk | |
| .gitignore | Add .eventlog to gitignore | |
| .woodpecker.yml | Add test suite | |
| CHANGELOG.md | Initial commit | |
| ghc-eventlog-loopback-test.eventlog | Initial commit | |
| ghc-eventlog-loopback.cabal | Link with -eventlog for the benefit of old versions of GHC | |
| LICENSE | Initial commit | |
| README.md | Add usage example | |
ghc-eventlog-loopback
This library provides a low overhead way to consume GHC's eventlog from inside the application that is emitting it.
Normally an eventlog is written to a file (controlled by the -ol RTS flag). This file must be stored and the processed.
eventlog-socket provides an alternative workflow where a user can create a persistent socket. Processing applications can then connect to this socket and see a valid stream of the eventlog.
Both of these options require managing either a file or a socket. This requires an extra operation overhead.
ghc-eventlog-loopback provides different trade-offs. It allows you to stream an application's eventlog into the application itself, so no extra external resource needs to be managed. It comes with the risk that eventlog processing can overwhelm an application. Users of the library should be careful to ensure that they can process the eventlog faster than it is output.
Example
To instrument your application you should do something like the following:
import Control.Monad
import GHC.RTS.Events.Loopback
import Control.Concurrent
process :: ByteString -> IO ()
...
main = do
void . forkIO . forever $ readEventLogChunk >>= process
start
...