Skip to content
  • Alp Mestanogullari's avatar
    compiler: trace SysTools commands to emit start/stop eventlog markers · 688a1b89
    Alp Mestanogullari authored and Marge Bot's avatar Marge Bot committed
    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, ...}".
    688a1b89