summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-04-16 15:19:01 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-04-30 20:41:42 -0400
commitebfa35284741fca47719f531f0996261441f75b0 (patch)
tree2f8241e34992d52309313a6cb1dbdc41d80415b4
parent1bef62c38d3737b5f5d7ebbb479f3c1a12b1aa09 (diff)
downloadhaskell-ebfa35284741fca47719f531f0996261441f75b0.tar.gz
Emit GHC timing events to eventlog
-rw-r--r--compiler/main/ErrUtils.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/main/ErrUtils.hs b/compiler/main/ErrUtils.hs
index ae147829aa..d036c1f7d9 100644
--- a/compiler/main/ErrUtils.hs
+++ b/compiler/main/ErrUtils.hs
@@ -653,10 +653,12 @@ withTiming getDFlags what force_result action
if verbosity dflags >= 2 || dopt Opt_D_dump_timings dflags
then do liftIO $ logInfo dflags (defaultUserStyle dflags)
$ text "***" <+> what <> colon
+ liftIO $ traceEventIO $ showSDocOneLine dflags $ text "GHC:started:" <+> what
alloc0 <- liftIO getAllocationCounter
start <- liftIO getCPUTime
!r <- action
() <- pure $ force_result r
+ liftIO $ traceEventIO $ showSDocOneLine dflags $ text "GHC:finished:" <+> what
end <- liftIO getCPUTime
alloc1 <- liftIO getAllocationCounter
-- recall that allocation counter counts down