Skip to content
Snippets Groups Projects
Commit 688a1b89 authored by Alp Mestanogullari's avatar Alp Mestanogullari :squid: Committed by Marge Bot
Browse files

compiler: trace SysTools commands to emit start/stop eventlog markers

This patch was motivated by some performance characterization work done
for #16822, where we suspected that GHC was spending a lot of time waiting
on the linker to be done. (That turned out to be true.)

The tracing is taken care of by ErrUtils.withTiming, so this patch just defines
and uses a little wrapper around that function in all the helpers for
calling the various systools (C compiler, linker, unlit, ...).

With this patch, assuming a GHC executable linked against an eventlog-capable
RTS (RTS ways that contain the debug, profiling or eventlog way units), we can
measure how much time is spent in each of the SysTools when building hello.hs
by simply doing:

  ghc hello.hs -ddump-timings +RTS -l

The event names are "systool:{cc, linker, as, unlit, ...}".
parent a31b24a5
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment