| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
foreign import ccall unsafe hs_hpc_write :: CString -> IO ()
foreign import ccall unsafe hs_hpc_read :: CString -> IO ()
These write a Hpc description of the state of the world to a file,
or read a description into the current Hpc tickbox subsystem.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When -fbreak-on-exception is set, an exception will cause GHCi to
suspend the current computation and return to the prompt, where the
history of the current evaluation can be inspected (if we are in
:trace). This isn't on by default, because the behaviour could be
confusing: for example, ^C will cause a breakpoint. It can be very
useful for finding the cause of a "head []" or a "fromJust Nothing",
though.
|
| |
|
|
|
|
|
|
|
|
|
| |
- .tix files are now a list of MixModule, which contain a hash of the contents of the .mix file.
- .mix files now have (the same) hash number.
This changes allow different binaries that use the same module compiled in the same way
to share coverage information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that constructor info tables contain the name of the constructor,
we can generate useful heap profiles without requiring the whole
program and libraries to be compiled with -prof. So now, "+RTS -hT"
generates a heap profile for any program, dividing the profile by
constructor. It wouldn't be hard to add support for grouping
constructors by module, or to restrict the profile to certain
constructors/modules/packages.
This means that for the first time we can get heap profiles for GHCi,
which was previously impossible because the byte-code
interpreter and linker don't work with -prof.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ticky StgEntCounter structure was trying to be clever by using a
fixed-width 32-bit field for the registeredp value. But the code generators
are not up to handling structures packed tightly like this (on a 64-bit
architecture); result seg-fault on 64-bit.
Really there should be some complaint from the code generators, not simply
a seg fault.
Anyway I switched to using native words for StgEntCounter fields, and
now at least it works.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the result of Bernie Pope's internship work at MSR Cambridge,
with some subsequent improvements by me. The main plan was to
(a) Reduce the overhead for breakpoints, so we could enable
the feature by default without incurrent a significant penalty
(b) Scatter more breakpoint sites throughout the code
Currently we can set a breakpoint on almost any subexpression, and the
overhead is around 1.5x slower than normal GHCi. I hope to be able to
get this down further and/or allow breakpoints to be turned off.
This patch also fixes up :print following the recent changes to
constructor info tables. (most of the :print tests now pass)
We now support single-stepping, which just enables all breakpoints.
:step <expr> executes <expr> with single-stepping turned on
:step single-steps from the current breakpoint
The mechanism is quite different to the previous implementation. We
share code with the HPC (haskell program coverage) implementation now.
The coverage pass annotates source code with "tick" locations which
are tracked by the coverage tool. In GHCi, each "tick" becomes a
potential breakpoint location.
Previously breakpoints were compiled into code that magically invoked
a nested instance of GHCi. Now, a breakpoint causes the current
thread to block and control is returned to GHCi.
See the wiki page for more details and the current ToDo list:
http://hackage.haskell.org/trac/ghc/wiki/NewGhciDebugger
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
We changed the convention a while ago so that BaseReg is returned to
the scheduler in R1, because BaseReg may change during the run of a
thread, e.g. during a foreign call. A few places got missed,
mostly for very rare events.
Should fix concprog001, although I'm not able to reliably reproduce
the failure.
|
|
|
|
| |
HANDLE is defined to be (void *) anyway, so this shouldn't hurt
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Tail-calls now branch to the end of the function after the call. This
stops gcc from trying to move instructions into the space immediately
after the call, which confuses the mangler.
|
| |
|
|
|
|
|
| |
We recently discovered that they aren't a win any more, and just cost
code size.
|
|
|
|
| |
This is a simplification & minor optimisation for GHCi
|
|
|
|
|
|
|
| |
This patch adds data constructor names into their info tables.
This is useful in the ghci debugger. It replaces the old scheme which
was based on tracking data con names in the linker.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Since thunks grew an extra padding word in GHC 6.6, closure_sizeW()
has been wrong for AP closures because it assumed compatible layout
between PAPs and APs. One symptom is that the compacting GC would
crash if it encountered an AP. APs conly crop up in GHCi or
when using asynchronous exceptions.
Fixes #1010
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following changes restore ticky-ticky profiling to functionality
from its formerly bit-rotted state. Sort of. (It got bit-rotted as part
of the switch to the C-- back-end.)
The way that ticky-ticky is supposed to work is documented in Section 5.7
of the GHC manual (though the manual doesn't mention that it hasn't worked
since sometime around 6.0, alas). Changes from this are as follows (which
I'll document on the wiki):
* In the past, you had to build all of the libraries with way=t in order to
use ticky-ticky, because it entailed a different closure layout. No longer.
You still need to do make way=t in rts/ in order to build the ticky RTS,
but you should now be able to mix ticky and non-ticky modules.
* Some of the counters that worked in the past aren't implemented yet.
I was originally just trying to get entry counts to work, so those should
be correct. The list of counters was never documented in the first place,
so I hope it's not too much of a disaster that some don't appear anymore.
Someday, someone (perhaps me) should document all the counters and what
they do. For now, all of the counters are either accurate (or at least as
accurate as they always were), zero, or missing from the ticky profiling
report altogether.
This hasn't been particularly well-tested, but these changes shouldn't
affect anything except when compiling with -fticky-ticky (famous last
words...)
Implementation details:
I got rid of StgTicky.h, which in the past had the macros and declarations
for all of the ticky counters. Now, those macros are defined in Cmm.h.
StgTicky.h was still there for inclusion in C code. Now, any remaining C
code simply cannot call the ticky macros -- or rather, they do call those
macros, but from the perspective of C code, they're defined as no-ops.
(This shouldn't be too big a problem.)
I added a new file TickyCounter.h that has all the declarations for ticky
counters, as well as dummy macros for use in C code. Someday, these
declarations should really be automatically generated, since they need
to be kept consistent with the macros defined in Cmm.h.
Other changes include getting rid of the header that was getting added to
closures before, and getting rid of various code having to do with eager
blackholing and permanent indirections (the changes under compiler/
and rts/Updates.*).
|
|
|
|
| |
with instructions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems that when a program exits with open DLLs on Windows, the
system attempts to shut down the DLLs, but it also terminates (some
of?) the running threads. The RTS isn't prepared for threads to die
unexpectedly, so it sits around waiting for its workers to finish.
This bites in two places: ShutdownIOManager() in the the unthreaded
RTS, and shutdownCapability() in the threaded RTS. So far I've
modified the latter to notice when worker threads have died
unexpectedly and continue shutting down. It seems a bit trickier to
fix the unthreaded RTS, so for now the workaround for #926 is to use
the threaded RTS.
|
|
|
|
|
|
|
|
| |
Similarly to the way we save errno across context switches and
suspendThread/resumeThread, we must save and restore the Win32 error
code via GetLastError()/SetLastError(). Fixes #896.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This patch extends the RTS linker and the dynamic linker so that it is possible to find out the datacon of a closure in heap at runtime:
- The RTS linker now carries a hashtable 'Address->Symbol' for data constructors
- The Persistent Linker State in the dynamic linker is extended in a similar way.
Finally, these two sources of information are consulted by:
> Linker.recoverDataCon :: a -> TcM Name
|
|
|
|
|
|
|
|
| |
- infoPtr# :: a -> Addr#
- closurePayload# :: a -> (# Array b, ByteArr# #)
These prim ops provide the magic behind the ':print' command
|
| |
|
|
|
|
|
|
|
|
| |
The main goal here is to reduce fragmentation, which turns out to be
the case of #743. While I was here I found some opportunities to
improve performance too. The code is rather more complex, but it also
contains a long comment describing the strategy, so please take a look
at that for the details.
|
|
|
|
|
|
|
| |
- Added HPCRIX support for passing tracer filename.
- Added thread tracing support.
- Cleaned up use of HsFFI.h
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes #637.
The implications of this change are:
- threadDelay on Windows no longer creates a new OS thread each time,
instead it communicates with the IO manager thread in the same way as
on Unix.
- deadlock detection now works the same way on Windows as on Unix; that
is the timer interrupt wakes up the IO manager thread, which causes
the scheduler to check for deadlock.
- Console events now get sent to the IO manager thread, in the same way as
signals do on Unix. This means that console events should behave more
reliably with -threaded on Windows.
All this applies only with -threaded. Without -threaded, the old
ConsoleEvent code is still used.
After some testing, this could be pushed to the 6.6 branch.
|
| |
|
|
|
|
|
| |
I'm not sure where the latter version came from, but it apparently
doesn't generate a legal instruction on Solaris.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Add the -L RTS flag to control the length of the cost-centre stacks reported in
a heap profile.
Please include this change in the 6.6 branch as well as HEAD
|
|
|
|
| |
architectures
|
| |
|
|
|
|
| |
Fixes stage 2 build with -fvia-C
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This large checkin is the new ghc version of Haskell
Program Coverage, an expression-level coverage tool for Haskell.
Parts:
- Hpc.[ch] - small runtime support for Hpc; reading/writing *.tix files.
- Coverage.lhs - Annotates the HsSyn with coverage tickboxes.
- New Note's in Core,
- TickBox -- ticked on entry to sub-expression
- BinaryTickBox -- ticked on exit to sub-expression, depending
-- on the boolean result.
- New Stg level TickBox (no BinaryTickBoxes, though)
You can run the coverage tool with -fhpc at compile time.
Main must be compiled with -fhpc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In preparation for parallel GC, split up the monolithic GC.c file into
smaller parts. Also in this patch (and difficult to separate,
unfortunatley):
- Don't include Stable.h in Rts.h, instead just include it where
necessary.
- consistently use STATIC_INLINE in source files, and INLINE_HEADER
in header files. STATIC_INLINE is now turned off when DEBUG is on,
to make debugging easier.
- The GC no longer takes the get_roots function as an argument.
We weren't making use of this generalisation.
|