diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-12-02 13:09:14 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-12-02 15:11:33 +0000 |
commit | 1469f1eb7817fbc46b17e994498450a9a6b12ea7 (patch) | |
tree | 698f0eadb98ed4276f2faf183492e9bfc2276b6b /includes/rts/prof | |
parent | 6f4bde149e46146125d688d9ff719c2e5e0800c2 (diff) | |
download | haskell-1469f1eb7817fbc46b17e994498450a9a6b12ea7.tar.gz |
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)
Diffstat (limited to 'includes/rts/prof')
-rw-r--r-- | includes/rts/prof/CCS.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/rts/prof/CCS.h b/includes/rts/prof/CCS.h index 9737fc9c18..36404aaf91 100644 --- a/includes/rts/prof/CCS.h +++ b/includes/rts/prof/CCS.h @@ -34,6 +34,7 @@ typedef struct _CostCentre { char * label; char * module; + char * srcloc; // used for accumulating costs at the end of the run... StgWord time_ticks; @@ -203,11 +204,12 @@ extern CostCentreStack * RTS_VAR(CCS_LIST); // registered CCS list * Declaring Cost Centres & Cost Centre Stacks. * -------------------------------------------------------------------------- */ -# define CC_DECLARE(cc_ident,name,mod,caf,is_local) \ +# define CC_DECLARE(cc_ident,name,mod,loc,caf,is_local) \ is_local CostCentre cc_ident[1] \ = {{ ccID : 0, \ label : name, \ module : mod, \ + srcloc : loc, \ time_ticks : 0, \ mem_alloc : 0, \ link : 0, \ |