More changes aimed at improving call stacks.
authorSimon Marlow <marlowsd@gmail.com>
Fri, 2 Dec 2011 13:09:14 +0000 (13:09 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Fri, 2 Dec 2011 15:11:33 +0000 (15:11 +0000)
commit1469f1eb7817fbc46b17e994498450a9a6b12ea7
tree698f0eadb98ed4276f2faf183492e9bfc2276b6b
parent6f4bde149e46146125d688d9ff719c2e5e0800c2
More changes aimed at improving call stacks.

  - Attach a SrcSpan to every CostCentre.  This had the side effect
    that CostCentres that used to be merged because they had the same
    name are now considered distinct; so I had to add a Unique to
    CostCentre to give them distinct object-code symbols.

  - New flag: -fprof-auto-calls.  This flag adds an automatic SCC to
    every call site (application, to be precise).  This is typically
    more useful for call stacks than annotating whole functions.

Various tidy-ups at the same time: removed unused NoCostCentre
constructor, and refactored a bit in Coverage.lhs.

The call stack we get from traceStack now looks like this:

Stack trace:
  Main.CAF (<entire-module>)
  Main.main.xs (callstack002.hs:18:12-24)
  Main.map (callstack002.hs:13:12-16)
  Main.map.go (callstack002.hs:15:21-34)
  Main.map.go (callstack002.hs:15:21-23)
  Main.f (callstack002.hs:10:7-43)
14 files changed:
compiler/basicTypes/Unique.lhs
compiler/codeGen/CgProf.hs
compiler/codeGen/StgCmmProf.hs
compiler/deSugar/Coverage.lhs
compiler/deSugar/DsExpr.lhs
compiler/iface/BinIface.hs
compiler/main/DynFlags.hs
compiler/profiling/CostCentre.lhs
compiler/profiling/SCCfinal.lhs
docs/users_guide/ghci.xml
docs/users_guide/profiling.xml
docs/users_guide/runtime_control.xml
includes/rts/prof/CCS.h
rts/Profiling.c