Skip to content

Instantly share code, notes, and snippets.

@ethercrow
Created May 10, 2020 11:22
Show Gist options
  • Save ethercrow/aa7fecc040c6f320199f82af6b1df0c0 to your computer and use it in GitHub Desktop.
Save ethercrow/aa7fecc040c6f320199f82af6b1df0c0 to your computer and use it in GitHub Desktop.
Debug printing of GHC eventlogs
#!/usr/bin/env stack
-- stack --resolver lts-15.11 --install-ghc script --compile --package ghc-events
{-# language lambdacase #-}
import ghc.rts.events
import system.environment
main :: io ()
main = do
[f] <- getargs
readeventlogfromfile f >>= \case
right l -> putstrln $ ppeventlog l
left err -> putstrln err
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment