| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not having SCCs at the top level is becoming annoying real quick. For
simplest cases, it's possible to do this transformation:
f x y = ...
=>
f = {-# SCC f #-} \x y -> ...
However, it doesn't work when there's a `where` clause:
f x y = <t is in scope>
where t = ...
=>
f = {-# SCC f #-} \x y -> <t is out of scope>
where t = ...
Or when we have a "equation style" definition:
f (C1 ...) = ...
f (C2 ...) = ...
f (C3 ...) = ...
...
(usual solution is to rename `f` to `f'` and define a new `f` with a
`SCC`)
This patch implements support for SCC annotations in declaration
contexts. This is now a valid program:
f x y = ...
where
g z = ...
{-# SCC g #-}
{-# SCC f #-}
Test Plan: This passes slow validate (no new failures added).
Reviewers: goldfire, mpickering, austin, bgamari, simonmar
Reviewed By: bgamari, simonmar
Subscribers: simonmar, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D2407
|
|
|
|
|
|
| |
* T7837 is still broken for prof_ways (#9406)
* T11627b is broken on Windows for WAY=prof_hc_hb (#12236)
* T8089 is also broken for WAY=profasm on Windows
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the problem with duplicate cost-centre names that was
reported a couple of times before. When a module implements a typeclass
multiple times for different types, methods of different implementations
get same cost-centre names and are reported like this:
COST CENTRE MODULE %time %alloc
CAF GHC.IO.Handle.FD 0.0 32.8
CAF GHC.Read 0.0 1.0
CAF GHC.IO.Encoding 0.0 1.8
showsPrec Main 0.0 1.2
readPrec Main 0.0 19.4
readPrec Main 0.0 20.5
main Main 0.0 20.2
individual inherited
COST CENTRE MODULE no. entries %time %alloc %time %alloc
MAIN MAIN 53 0 0.0 0.2 0.0 100.0
CAF Main 105 0 0.0 0.3 0.0 62.5
readPrec Main 109 1 0.0 0.6 0.0 0.6
readPrec Main 107 1 0.0 0.6 0.0 0.6
main Main 106 1 0.0 20.2 0.0 61.0
== Main 114 1 0.0 0.0 0.0 0.0
== Main 113 1 0.0 0.0 0.0 0.0
showsPrec Main 112 2 0.0 1.2 0.0 1.2
showsPrec Main 111 2 0.0 0.9 0.0 0.9
readPrec Main 110 0 0.0 18.8 0.0 18.8
readPrec Main 108 0 0.0 19.9 0.0 19.9
It's not possible to tell from the report which `==` took how long. This
patch adds one more column at the cost of making outputs wider. The
report now looks like this:
COST CENTRE MODULE SRC %time %alloc
CAF GHC.IO.Handle.FD <entire-module> 0.0 32.9
CAF GHC.IO.Encoding <entire-module> 0.0 1.8
CAF GHC.Read <entire-module> 0.0 1.0
showsPrec Main Main_1.hs:7:19-22 0.0 1.2
readPrec Main Main_1.hs:7:13-16 0.0 19.5
readPrec Main Main_1.hs:4:13-16 0.0 20.5
main Main Main_1.hs:(10,1)-(20,20) 0.0 20.2
individual inherited
COST CENTRE MODULE SRC no. entries %time %alloc %time %alloc
MAIN MAIN <built-in> 53 0 0.0 0.2 0.0 100.0
CAF Main <entire-module> 105 0 0.0 0.3 0.0 62.5
readPrec Main Main_1.hs:7:13-16 109 1 0.0 0.6 0.0 0.6
readPrec Main Main_1.hs:4:13-16 107 1 0.0 0.6 0.0 0.6
main Main Main_1.hs:(10,1)-(20,20) 106 1 0.0 20.2 0.0 61.0
== Main Main_1.hs:7:25-26 114 1 0.0 0.0 0.0 0.0
== Main Main_1.hs:4:25-26 113 1 0.0 0.0 0.0 0.0
showsPrec Main Main_1.hs:7:19-22 112 2 0.0 1.2 0.0 1.2
showsPrec Main Main_1.hs:4:19-22 111 2 0.0 0.9 0.0 0.9
readPrec Main Main_1.hs:7:13-16 110 0 0.0 18.8 0.0 18.8
readPrec Main Main_1.hs:4:13-16 108 0 0.0 19.9 0.0 19.9
CAF Text.Read.Lex <entire-module> 102 0 0.0 0.5 0.0 0.5
To fix failing test cases because of different orderings of cost centres
(e.g. optimized and non-optimized build printing in different order),
with this patch we also start sorting cost centres before printing. The
order depends on 1) entries (more entered cost centres come first) 2)
names (using strcmp() on cost centre names).
Reviewers: simonmar, austin, erikd, bgamari
Reviewed By: simonmar, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2282
GHC Trac Issues: #11543, #8473, #7105
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change help message so it doesn't specify -auto-all.
Make old profiling flags deprecated as they are no longer
documented.
Update Makefile and documentation accordingly.
Update release notes for ghc 8.2
Test Plan:
./verify; `ghc --help` shouldn't specify the -auto-all
flag. Furthermore `ghc -fprof -auto-all` should emit a warning
Reviewed By: thomie, austin
Differential Revision: https://phabricator.haskell.org/D2257
GHC Trac Issues: #12084
Update submodule nofib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test Plan: validate
Reviewers: carter, austin, simonmar, bgamari
Reviewed By: simonmar, bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2154
GHC Trac Issues: #11978
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The heap census now handles large ARR_WORDS objects which have
been shrunk by shrinkMutableByteArray# or resizeMutableByteArray#.
Test Plan: ./validate && make test WAY=profasm
Reviewers: hvr, bgamari, austin, thomie
Reviewed By: thomie
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2005
GHC Trac Issues: #11627
|
| |
|
|
|
|
| |
These tests fail not only for WAY=prof, but also for WAY=profllvm.
|
| |
|
|
|
|
|
| |
Refactoring only. I compared before and after with 'make slow', and it
still runs each test with the same 'ways' as before.
|
| |
|
| |
|
| |
|
|
|
|
| |
There were a couple of broken profiling tests.
|
|
|
|
|
| |
See comment in `AutoApply.h`. This partly fixes #5654. New test
added, and renamed the old test to match the ticket number.
|
|
|
|
|
|
| |
* T2552 (#10037) is failng for all threaded opt_ways, not for WAY=prof.
* TH_spliceE5_prof (#11495) is failing when ghc_dynamic
* Rename ghci_dynamic to ghc_dynamic. It's the same thing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two ways to do retainer profiling. Quoting from the user's guide:
1. `+RTS -hr` "Breaks down the graph by retainer set"
2. `+RTS -hr<cc> -h<x>`, where `-h<x>` is one of normal heap profiling
break-down options (e.g. `-hc`), and `-hr<cc> means "Restrict the
profile to closures with retainer sets containing cost-centre
stacks with one of the specified cost centres at the top."
Retainer profiling writes to a .hp file, like the other heap profiling
options, but also to a .prof file. Therefore, when the .prof file is not
writeable for whatever reason, retainer profiling should be turned off
completely.
This worked ok when running the program with `+RTS -hr` (option 1), but a
segfault would occur when using `+RTS -hr<cc> -h<x>`, with `x!=r` (option 2).
This commit fixes that.
Reviewed by: bgamari
Differential Revision: https://phabricator.haskell.org/D1849
GHC Trac Issues: #11489
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Was broken by ce1f1607ed7f8fedd2f63c8610cafefd59baaf32. I've added a
test so that hopefully it won't break again.
Test Plan: validate & new test case
Reviewers: bgamari, austin, erikd
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1746
GHC Trac Issues: #11304
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
(Apologies for the size of this patch, I couldn't make a smaller one
that was validate-clean and also made sense independently)
(Some of this code is derived from GHCJS.)
This commit adds support for running interpreted code (for GHCi and
TemplateHaskell) in a separate process. The functionality is
experimental, so for now it is off by default and enabled by the flag
-fexternal-interpreter.
Reaosns we want this:
* compiling Template Haskell code with -prof does not require
building the code without -prof first
* when GHC itself is profiled, it can interpret unprofiled code, and
the same applies to dynamic linking. We would no longer need to
force -dynamic-too with TemplateHaskell, and we can load ordinary
objects into a dynamically-linked GHCi (and vice versa).
* An unprofiled GHCi can load and run profiled code, which means it
can use the stack-trace functionality provided by profiling without
taking the performance hit on the compiler that profiling would
entail.
Amongst other things; see
https://ghc.haskell.org/trac/ghc/wiki/RemoteGHCi for more details.
Notes on the implementation are in Note [Remote GHCi] in the new
module compiler/ghci/GHCi.hs. It probably needs more documenting,
feel free to suggest things I could elaborate on.
Things that are not currently implemented for -fexternal-interpreter:
* The GHCi debugger
* :set prog, :set args in GHCi
* `recover` in Template Haskell
* Redirecting stdin/stdout for the external process
These are all doable, I just wanted to get to a working validate-clean
patch first.
I also haven't done any benchmarking yet. I expect there to be slight hit
to link times for byte code and some penalty due to having to
serialize/deserialize TH syntax, but I don't expect it to be a serious
problem. There's also lots of low-hanging fruit in the byte code
generator/linker that we could exploit to speed things up.
Test Plan:
* validate
* I've run parts of the test suite with
EXTRA_HC_OPTS=-fexternal-interpreter, notably tests/ghci and tests/th.
There are a few failures due to the things not currently implemented
(see above).
Reviewers: simonpj, goldfire, ezyang, austin, alanz, hvr, niteria, bgamari, gibiansky, luite
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1562
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The idea here is that this gives a more detailed stack trace in two
cases:
1. With `-prof` and `-fprof-auto`
2. In GHCi (see #11047)
Example, with an error inserted in nofib/shootout/binary-trees:
```
$ ./Main 3
Main: z
CallStack (from ImplicitParams):
error, called at Main.hs:67:29 in main:Main
CallStack (from -prof):
Main.check' (Main.hs:(67,1)-(68,82))
Main.check (Main.hs:63:1-21)
Main.stretch (Main.hs:32:35-57)
Main.main.c (Main.hs:32:9-57)
Main.main (Main.hs:(27,1)-(43,42))
Main.CAF (<entire-module>)
```
This doesn't quite obsolete +RTS -xc, which also attempts to display
more information in the case when the error is in a CAF, but I'm
exploring other solutions to that.
Includes submodule updates.
Test Plan: validate
Reviewers: simonpj, ezyang, gridaphobe, bgamari, hvr, austin
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1426
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Amazingly, there were zero changes to the byte code generator and very
few changes to the interpreter - mainly because we've used good
abstractions that hide the differences between profiling and
non-profiling. So that bit was pleasantly straightforward, but there
were a pile of other wibbles to get the whole test suite through.
Note that a compiler built with -prof is now like one built with
-dynamic, in that to use TH you have to build the code the same way.
For dynamic, we automatically enable -dynamic-too when TH is required,
but we don't have anything equivalent for profiling, so you have to
explicitly use -prof when building code that uses TH with a profiled
compiler. For this reason Cabal won't work with TH. We don't expect
to ship a profiled compiler, so I think that's OK.
Test Plan: validate with GhcProfiled=YES in validate.mk
Reviewers: goldfire, bgamari, rwbarton, austin, hvr, erikd, ezyang
Reviewed By: ezyang
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1407
GHC Trac Issues: #4837, #545
|
| |
|
|
|
|
|
|
| |
Reviewed By: thomie
Differential Revision: https://phabricator.haskell.org/D779
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We were erroneously discarding SCCs on function-typed variables.
These can affect the call stack, so we have to retain them. The bug
was introduced during the recent SourceNote refactoring.
This is an alternative to the fix proposed in D616. I also added the
scc005 test from that diff, which works with this change.
While I was here, I also fixed up the other profiling tests, marking a
few as expect_broken_for(10037) where the opt/unopt output differs in
non-fatal ways.
Test Plan: profiling tests
Reviewers: scpmw, ezyang, austin
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D636
GHC Trac Issues: #10007
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
I think the change to compile top-level indirections more efficiently
removed the "CAF" entries from the stack. That's a surprising
side-effect, but it's not really a problem.
|
| |
|
|
|
|
| |
The driver now also supports nested lists of setup functions
|
| |
|
| |
|
|
|
|
| |
I had the test lying around already, just hooking it up
|
| |
|
| |
|
| |
|
|
|
|
| |
Stack trace order has been reversed.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|