summaryrefslogtreecommitdiff
path: root/testsuite/tests/profiling
Commit message (Collapse)AuthorAgeFilesLines
* Support SCC pragmas in declaration contextÖmer Sinan Ağacan2016-07-205-1/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Testsuite: mark tests expect_brokenThomas Miedema2016-06-281-0/+2
| | | | | | * 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
* Testsuite: tabs -> spaces [skip ci]Thomas Miedema2016-06-201-14/+14
|
* Show sources of cost centers in .profÖmer Sinan Ağacan2016-06-0814-312/+315
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix: #12084 deprecate old profiling flagsSeraphime Kirkovski2016-05-244-6/+6
| | | | | | | | | | | | | | | | | | | | 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
* rts/LdvProfile.c: Fix NULL dereference on shutdownErik de Castro Lopo2016-04-293-0/+7
| | | | | | | | | | | | | | 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
* Tes suite output updatesJoachim Breitner2016-03-291-23/+23
|
* prof: Fix heap census for large ARR_WORDS (#11627)Jason Eisenberg2016-03-204-0/+57
| | | | | | | | | | | | | | | | | 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
* Typos in comments, etc.Gabor Greif2016-02-262-2/+2
|
* Testsuite: failing profiling tests (#10037)Thomas Miedema2016-02-231-5/+8
| | | | These tests fail not only for WAY=prof, but also for WAY=profllvm.
* Filter out -prof callstacks from test output (#11521)Thomas Miedema2016-02-231-0/+1
|
* Testsuite: cleanup profiling/should_run/all.T (#11521)Thomas Miedema2016-02-232-100/+44
| | | | | Refactoring only. I compared before and after with 'make slow', and it still runs each test with the same 'ways' as before.
* Testsuite: delete Windows line endings [skip ci] (#11631)Thomas Miedema2016-02-231-1/+1
|
* Add missing filesSimon Marlow2016-02-232-0/+44
|
* A few more typos in non-codeGabor Greif2016-02-191-1/+1
|
* Update profiling test outputSimon Marlow2016-01-271-25/+26
| | | | There were a couple of broken profiling tests.
* Fix cost-centre-stack bug when creating new PAP (#5654)Simon Marlow2016-01-277-11/+104
| | | | | See comment in `AutoApply.h`. This partly fixes #5654. New test added, and renamed the old test to match the ticket number.
* Testsuite: fixup req_profiling tests (#11496)Thomas Miedema2016-01-273-4/+4
| | | | | | * 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.
* Fix segmentation fault when .prof file not writeableThomas Miedema2016-01-264-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename the test-way prof_h to normal_hSimon Marlow2016-01-081-1/+1
|
* Fix +RTS -h when compiling without -profSimon Marlow2016-01-082-2/+16
| | | | | | | | | | | | | | | | 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
* Remote GHCi, -fexternal-interpreterSimon Marlow2015-12-171-20/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make 'error' include the CCS call stack when profiledSimon Marlow2015-11-131-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Make GHCi & TH work when the compiler is built with -profSimon Marlow2015-11-072-26/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Testsuite: accept T2592.stderr (minor changes)Thomas Miedema2015-06-301-2/+2
|
* Stop profiling output from running together (#8811)Dave Laing2015-04-0611-235/+244
| | | | | | Reviewed By: thomie Differential Revision: https://phabricator.haskell.org/D779
* Fix a profiling bugSimon Marlow2015-02-046-69/+115
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Update expected profiling output for scc001Joachim Breitner2014-11-031-18/+23
|
* testsuite: AMPify T3001-2Joachim Breitner2014-09-101-4/+14
|
* testsuite: AMPify ioprof.hsJoachim Breitner2014-09-101-0/+9
|
* Changed profiling output is fine (according to Simon Marlow)Simon Peyton Jones2014-05-051-29/+27
|
* Add -fno-full-laziness to get consistent profiling outputSimon Peyton Jones2014-05-051-1/+1
|
* accept outputSimon Marlow2013-02-191-2/+2
| | | | | | 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.
* unsafePerformIO movedSimon Marlow2013-02-191-0/+1
|
* Remove uses of compose(s) in tests, and change how composition is handledIan Lynagh2013-02-142-7/+7
| | | | The driver now also supports nested lists of setup functions
* Rename some numeric tests: nnnn -> TnnnnIan Lynagh2013-01-257-4/+4
|
* Fix failures in the full testsuitePaolo Capriotti2012-07-271-1/+3
|
* add a test for INLINE and -fprof-auto (#6131)Simon Marlow2012-06-154-0/+44
| | | | I had the test lying around already, just hooking it up
* add 32-bit outputSimon Marlow2011-12-191-0/+1
|
* accept outputSimon Marlow2011-12-191-1/+1
|
* add test from #5363Simon Marlow2011-12-073-0/+19
|
* Accept output for callstack002Ian Lynagh2011-12-072-16/+16
| | | | Stack trace order has been reversed.
* Update adding source locations to cost centres.Simon Marlow2011-12-026-40/+43
|
* callstack001: add -fno-state-hack to get consistent outputSimon Marlow2011-12-012-3/+3
|
* Test for Debug.Trace.traceStack and GHC.Stack.whoCreatedSimon Marlow2011-12-014-0/+48
|
* accept outputSimon Marlow2011-11-301-2/+2
|
* callstack001 requires profilingIan Lynagh2011-11-291-2/+3
|
* test for GHC.Exts.currentCallStackSimon Marlow2011-11-293-0/+23
|
* simplify using prof_waysSimon Marlow2011-11-291-13/+13
|
* add test scc004 which is expect_broken(#5654)Simon Marlow2011-11-233-0/+44
|