summaryrefslogtreecommitdiff
path: root/compiler/main/CodeOutput.hs
diff options
context:
space:
mode:
authorAlp Mestanogullari <alpmestan@gmail.com>2019-09-07 10:51:47 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-19 21:42:17 -0400
commitb3e5c73119e5c3bf801885e56cababa446434211 (patch)
tree52a6c4df29305d1f25bb762371f650496e85f00c /compiler/main/CodeOutput.hs
parent521739900fe993ff73ec0da2215bc7572a15826d (diff)
downloadhaskell-b3e5c73119e5c3bf801885e56cababa446434211.tar.gz
ErrUtils: split withTiming into withTiming and withTimingSilent
'withTiming' becomes a function that, when passed '-vN' (N >= 2) or '-ddump-timings', will print timing (and possibly allocations) related information. When additionally built with '-eventlog' and executed with '+RTS -l', 'withTiming' will also emit both 'traceMarker' and 'traceEvent' events to the eventlog. 'withTimingSilent' on the other hand will never print any timing information, under any circumstance, and will only emit 'traceEvent' events to the eventlog. As pointed out in !1672, 'traceMarker' is better suited for things that we might want to visualize in tools like eventlog2html, while 'traceEvent' is better suited for internal events that occur a lot more often and that we don't necessarily want to visualize. This addresses #17138 by using 'withTimingSilent' for all the codegen bits that are expressed as a bunch of small computations over streams of codegen ASTs.
Diffstat (limited to 'compiler/main/CodeOutput.hs')
-rw-r--r--compiler/main/CodeOutput.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/main/CodeOutput.hs b/compiler/main/CodeOutput.hs
index 839999a32c..4109e50c02 100644
--- a/compiler/main/CodeOutput.hs
+++ b/compiler/main/CodeOutput.hs
@@ -70,9 +70,10 @@ codeOutput dflags this_mod filenm location foreign_stubs foreign_fps pkg_deps
then Stream.mapM do_lint cmm_stream
else cmm_stream
- do_lint cmm = withTiming (pure dflags)
- (text "CmmLint"<+>brackets (ppr this_mod))
- (const ()) $ do
+ do_lint cmm = withTimingSilent
+ (pure dflags)
+ (text "CmmLint"<+>brackets (ppr this_mod))
+ (const ()) $ do
{ case cmmLint dflags cmm of
Just err -> do { log_action dflags
dflags