summaryrefslogtreecommitdiff
path: root/includes
Commit message (Collapse)AuthorAgeFilesLines
...
* | Overhaul of infrastructure for profiling, coverage (HPC) and breakpointsSimon Marlow2011-11-022-94/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User visible changes ==================== Profilng -------- Flags renamed (the old ones are still accepted for now): OLD NEW --------- ------------ -auto-all -fprof-auto -auto -fprof-exported -caf-all -fprof-cafs New flags: -fprof-auto Annotates all bindings (not just top-level ones) with SCCs -fprof-top Annotates just top-level bindings with SCCs -fprof-exported Annotates just exported bindings with SCCs -fprof-no-count-entries Do not maintain entry counts when profiling (can make profiled code go faster; useful with heap profiling where entry counts are not used) Cost-centre stacks have a new semantics, which should in most cases result in more useful and intuitive profiles. If you find this not to be the case, please let me know. This is the area where I have been experimenting most, and the current solution is probably not the final version, however it does address all the outstanding bugs and seems to be better than GHC 7.2. Stack traces ------------ +RTS -xc now gives more information. If the exception originates from a CAF (as is common, because GHC tends to lift exceptions out to the top-level), then the RTS walks up the stack and reports the stack in the enclosing update frame(s). Result: +RTS -xc is much more useful now - but you still have to compile for profiling to get it. I've played around a little with adding 'head []' to GHC itself, and +RTS -xc does pinpoint the problem quite accurately. I plan to add more facilities for stack tracing (e.g. in GHCi) in the future. Coverage (HPC) -------------- * derived instances are now coloured yellow if they weren't used * likewise record field names * entry counts are more accurate (hpc --fun-entry-count) * tab width is now correct (markup was previously off in source with tabs) Internal changes ================ In Core, the Note constructor has been replaced by Tick (Tickish b) (Expr b) which is used to represent all the kinds of source annotation we support: profiling SCCs, HPC ticks, and GHCi breakpoints. Depending on the properties of the Tickish, different transformations apply to Tick. See CoreUtils.mkTick for details. Tickets ======= This commit closes the following tickets, test cases to follow: - Close #2552: not a bug, but the behaviour is now more intuitive (test is T2552) - Close #680 (test is T680) - Close #1531 (test is result001) - Close #949 (test is T949) - Close #2466: test case has bitrotted (doesn't compile against current version of vector-space package)
* | Add an RTS eventlog tracing class for user messagesDuncan Coutts2011-10-271-0/+1
| | | | | | | | Enables people to turn them on/off. Defaults to on.
* | Add new eventlog EVENT_WALL_CLOCK_TIME for time matchingDuncan Coutts2011-10-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Eventlog timestamps are elapsed times (in nanoseconds) relative to the process start. To be able to merge eventlogs from multiple processes we need to be able to align their timelines. If they share a clock domain (or a user judges that their clocks are sufficiently closely synchronised) then it is sufficient to know how the eventlog timestamps match up with the clock. The EVENT_WALL_CLOCK_TIME contains the clock time with (up to) nanosecond precision. It is otherwise an ordinary event and so contains the usual timestamp for the same moment in time. It therefore enables us to match up all the eventlog timestamps with clock time.
* | Merge branch 'master' of http://darcs.haskell.org/ghcIan Lynagh2011-10-191-2/+1
|\ \ | | | | | | | | | | | | Conflicts: compiler/utils/Platform.hs
| * | Revert "Move freeStablePtr() into the exported API (Lennart wants it)"Simon Marlow2011-10-191-2/+1
| | | | | | | | | | | | | | | | | | | | | On second thoughts, hs_free_stable_ptr() is the official way to free a StablePtr. This reverts commit ae583f2949570755c8a03f68a71416c0fd7f257c.
* | | Put the target platform in the settings fileIan Lynagh2011-10-192-32/+0
|/ /
* | Move freeStablePtr() into the exported API (Lennart wants it)Simon Marlow2011-10-181-1/+2
| |
* | make CAFs atomic, to fix #5558Simon Marlow2011-10-171-2/+2
|/ | | | See Note [atomic CAFs] in rts/sm/Storage.c
* Increase the "context stack depth" to 200 (from 20)Simon Peyton Jones2011-09-021-2/+2
| | | | | | | | | | | This parameter controls the allowed depth of reasoning in the type constraint solver. Perfectly well-behaved programs can use deep stacks, and 20 is obviously too small. (Indeed, if you don't have UndecidableInstances, the constraint solver is supposed to terminate, so no limit should be needed.) Responding to Trac #5395 this patch increases the default to 200.
* Snapshot of codegen refactoring to share with simonpjSimon Marlow2011-08-251-4/+4
|
* make shutdownHaskellAndExit() shut down the RTS and exit immediatelySimon Marlow2011-08-121-1/+5
| | | | (#5402)
* ARMv5 compatibility for registerized runtime changes.Stephen Blackheath2011-08-104-26/+46
| | | | | | | When the bootstrap compiler does not include this patch, you must add this line to mk/build.mk, otherwise the ARM architecture cannot be detected due to a -undef option given to the C pre-processor. SRC_HC_OPTS = -pgmP 'gcc -E -traditional'
* RTS: fix xchg/cas fcns to invoke memory barrier on ARMv7 platformKarel Gardas2011-08-101-0/+6
| | | | | | This patch fixes RTS' xchg and cas functions. On ARMv7 it is recommended to add memory barrier after using ldrex/strex for implementing atomic lock or operation.
* implement ARMv7 specific memory barriersKarel Gardas2011-08-101-1/+11
| | | | | | This patch provides implementation of ARMv7 specific memory barriers. It uses dmb sy isn (or shortly dmb) for store/load and load/load barriers and dmb st isn for store/store barrier.
* add support for STG floating-point regs using VFPv3Karel Gardas2011-08-101-2/+44
| | | | | | | This patch adds mapping for STG floating point registers using ARM VFPv3. Since I'm using just d8-d11 also processors with just VFPv3-D16 implemented should work (e.g. NVidia Tegra2, Marvell Dove)
* make StgReturn and cas functions Thumb friendlyKarel Gardas2011-08-101-0/+2
|
* implement ARMv6/7 specific xchg functionKarel Gardas2011-08-101-2/+18
|
* Stephen Blackheath's GHC/ARM registerised portKarel Gardas2011-08-102-0/+64
| | | | | | This is the Stephen Blackheath's GHC/ARM registerised port which is using modified version of LLVM and which provides basic registerised build functionality
* Also include basic time statistics in GCStats.Edward Z. Yang2011-08-061-0/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Implement public interface for GC statistics.Edward Z. Yang2011-07-301-0/+44
| | | | | | | | | | | We add a new RTS flag -T for collecting statistics but not giving any new inputs. There is one new struct in rts/storage/GC.h: GCStats. We add two new global counters current_residency and current_slop, which are useful for in-program GC statistics. See GHC.Stats in base for a Haskell interface to this functionality. Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Update some files for new testsuite tests locationDavid Terei2011-07-201-1/+1
|
* comment updatesSimon Marlow2011-07-201-2/+2
|
* Sync EventLogFormat.h with ghc-eventsDuncan Coutts2011-07-181-2/+5
|
* Add new fully-accurate per-spark trace/eventlog eventsDuncan Coutts2011-07-182-5/+15
| | | | | | | | | | | | | | Replaces the existing EVENT_RUN/STEAL_SPARK events with 7 new events covering all stages of the spark lifcycle: create, dud, overflow, run, steal, fizzle, gc The sampled spark events are still available. There are now two event classes for sparks, the sampled and the fully accurate. They can be enabled/disabled independently. By default +RTS -l includes the sampled but not full detail spark events. Use +RTS -lf-p to enable the detailed 'f' and disable the sampled 'p' spark. Includes work by Mikolaj <mikolaj.konarski@gmail.com>
* Move GC tracing into a separate trace classDuncan Coutts2011-07-181-0/+1
| | | | | | | Previously GC was included in the scheduler trace class. It can be enabled specifically with +RTS -vg or -lg, though note that both -v and -l on their own now default to a sensible set of trace classes, currently: scheduler, gc and sparks.
* add a new trace class for spark eventsDuncan Coutts2011-07-181-1/+1
|
* Add spark counter tracingDuncan Coutts2011-07-181-1/+2
| | | | | | | A new eventlog event containing 7 spark counters/statistics: sparks created, dud, overflowed, converted, GC'd, fizzled and remaining. These are maintained and logged separately for each capability. We log them at startup, on each GC (minor and major) and on shutdown.
* remove getOrSetTypeableStore. This is no longer used after the switchSimon Marlow2011-07-121-1/+0
| | | | to using MD5 hashes to identify TypeReps in the Typeable library.
* Emit various bits of OS process info into the eventlogDuncan Coutts2011-05-261-1/+39
| | | | | The process ID, parent process ID, rts name and version The program arguments and environment.
* prog_argv and rts_argv now contain *copies* of the args passed toSimon Marlow2011-05-252-5/+2
| | | | | | setupRtsFlags(), rather than sharing the memory. Previously if the caller of hs_init() passed in dynamically-allocated memory and then freed it, random crashes could happen later (#5177).
* fix an integer overflow (#5086), and pre-emptively avoid more of theseSimon Marlow2011-05-251-9/+17
| | | | in the future.
* Revert "Add capability sets to the event system. Contains code from Duncan ↵Duncan Coutts2011-05-231-38/+1
| | | | | | | | Coutts." This reverts commit 58532eb46041aec8d4cbb48b054cb5b001edb43c. Turns out it didn't work on Windows and it'll need some non-trivial changes to make it work on Windows. We'll get it in later once that's sorted out.
* Make array copy primops inlineJohan Tibell2011-05-191-6/+0
|
* Add array copy/clone primopsDaniel Peebles2011-05-192-2/+10
|
* Add capability sets to the event system. Contains code from Duncan Coutts.Spencer Janssen2011-05-181-1/+38
|
* Work around lack of saving volatile registers from unsafe foreign calls.Edward Z. Yang2011-05-151-0/+5
| | | | Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
* Unicode fixes, taking into account PEP383 supportMax Bolingbroke2011-05-141-0/+6
|
* Don't expose the cas definition to .hc filesIan Lynagh2011-04-301-0/+2
| | | | | This is more pleasant than having the C generator check whether the function it's calling is cas, and not generate a prototype if so.
* Change the way module initialisation is done (#3252, #4417)Simon Marlow2011-04-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the code generator generated small code fragments labelled with __stginit_M for each module M, and these performed whatever initialisation was necessary for that module and recursively invoked the initialisation functions for imported modules. This appraoch had drawbacks: - FFI users had to call hs_add_root() to ensure the correct initialisation routines were called. This is a non-standard, and ugly, API. - unless we were using -split-objs, the __stginit dependencies would entail linking the whole transitive closure of modules imported, whether they were actually used or not. In an extreme case (#4387, #4417), a module from GHC might be imported for use in Template Haskell or an annotation, and that would force the whole of GHC to be needlessly linked into the final executable. So now instead we do our initialisation with C functions marked with __attribute__((constructor)), which are automatically invoked at program startup time (or DSO load-time). The C initialisers are emitted into the stub.c file. This means that every time we compile with -prof or -hpc, we now get a stub file, but thanks to #3687 that is now invisible to the user. There are some refactorings in the RTS (particularly for HPC) to handle the fact that initialisers now get run earlier than they did before. The __stginit symbols are still generated, and the hs_add_root() function still exists (but does nothing), for backwards compatibility.
* Cleanup sweep and fix a bug in RTS flag processing.Simon Marlow2011-04-123-14/+6
| | | | | | | | | | | | | This code has accumulated a great deal of cruft over the years, this pass cleans up a lot of the surrounding cruft but leaves the actual argument processing alone - so there's still more that could be done. Bug fixed: - ghc_rts_opts should not be subject to the --rtsopts setting. If the programmer explicitly declares options with ghc_rts_opts, they shouldn't also have to accept command-line RTS options to make them work.
* add casMutVar#Simon Marlow2011-04-112-1/+3
|
* Windows build fix: ignore pthread.h if it exists (#4989)Simon Marlow2011-03-301-1/+1
|
* Make include file paths a little prettierIan Lynagh2011-03-161-0/+2
| | | | | This isn't important, but it stops us getting [...]/./[...] in the paths in bindists.
* GHC.Prim.threadStatus# now returns the cap number, and the value of TSO_LOCKEDSimon Marlow2011-03-011-0/+1
|
* replace C++ comments with C comments (Solaris' DTrace fails on C++ comments)Karel Gardas2011-01-121-3/+3
|
* fix TRY_ACQUIRE_LOCK on Windows.Simon Marlow2011-02-101-1/+1
|
* GC refactoring and cleanupSimon Marlow2011-02-021-4/+1
| | | | | | | | | Now we keep any partially-full blocks in the gc_thread[] structs after each GC, rather than moving them to the generation. This should give us slightly better locality (though I wasn't able to measure any difference). Also in this patch: better sanity checking with THREADED.
* A small GC optimisationSimon Marlow2011-02-022-15/+34
| | | | | | Store the *number* of the destination generation in the Bdescr struct, so that in evacuate() we don't have to deref gen to get it. This is another improvement ported over from my GC branch.
* add a constSimon Marlow2011-02-021-1/+1
|
* add TRY_ACQUIRE_LOCK()Simon Marlow2011-02-021-2/+11
|