| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the other users of the fptools build system have migrated to
Cabal, and with the move to darcs we can now flatten the source tree
without losing history, so here goes.
The main change is that the ghc/ subdir is gone, and most of what it
contained is now at the top level. The build system now makes no
pretense at being multi-project, it is just the GHC build system.
No doubt this will break many things, and there will be a period of
instability while we fix the dependencies. A straightforward build
should work, but I haven't yet fixed binary/source distributions.
Changes to the Building Guide will follow, too.
|
|
|
|
|
|
|
| |
Remove uses of stderr from .cmm code.
We can't reliably refer to stdin/stdout/stderr from .cmm, because the
C standard doesn't specify whether stderr is a variable or a macro.
|
|
|
|
|
|
|
|
|
|
| |
* Some preprocessors don't like the C99/C++ '//' comments after a
directive, so use '/* */' instead. For consistency, a lot of '//' in
the include files were converted, too.
* UnDOSified libraries/base/cbits/runProcess.c.
* My favourite sport: Killed $Id$s.
|
|
|
|
| |
Warning police. Why is x86_init_fpu disabled, BTW?
|
|
|
|
|
| |
Removed the annoying "Id" CVS keywords, they're a real PITA when it
comes to merging...
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cleanup: all (well, most) messages from the RTS now go through the
functions in RtsUtils: barf(), debugBelch() and errorBelch(). The
latter two were previously called belch() and prog_belch()
respectively. See the comments for the right usage of these message
functions.
One reason for doing this is so that we can avoid spurious uses of
stdout/stderr by Haskell apps on platforms where we shouldn't be using
them (eg. non-console apps on Windows).
|
|
|
|
| |
Fix profiling (ASSIGN_CCSID macros had gone away).
|
|
|
|
| |
Merge backend-hacking-branch onto HEAD. Yay!
|
|
|
|
|
|
|
|
|
|
|
|
| |
setupRtsFlags(): don't overwrite argv[0] with its basename:
- argv[] may not point to writeable memory
- System.Environment.getProgName strips off the 'dirname' portion
anyway.
- Not possible to get at the untransformed argv[0] from
Haskell code, should such a need arise.
Uses of prog_argv[0] within the RTS has now been replaced with prog_name,
which is the basename of prog_argv[0].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up code&interfaces that deals with timers and asynchrony:
- Timer.{c,h} now defines the platform-independent interface
to the timing services needed by the RTS. Itimer.{c,h} +
win32/Ticker.{c,h} defines the OS-specific services that
creates/destroys a timer.
- For win32 plats, drop the long-standing use of the 'multimedia'
API timers and implement the ticking service ourselves. Simpler
and more flexible.
- Select.c is now solely for platforms that use select() to handle
non-blocking I/O & thread delays. win32/AwaitEvent.c provides
the same API on the Win32 side.
- support threadDelay on win32 platforms via worker threads.
Not yet compiled up on non-win32 platforms; will do once checked in.
|
|
|
|
| |
Warning police (labels at end of compound statements are uncool, GCC says...)
|
|
|
|
| |
warning police: #include <string.h> to get proto for strlen()
|
|
|
|
|
|
| |
total_alloc should be a 64-bit couunter.
MERGE TO STABLE
|
|
|
|
|
|
|
|
| |
Allow module names up to 50 chars wide without misalignment of the
profiling table. For example: "Graphics.UI.ObjectIO.Process.Toolbar"
no longer messes up the output.
The output is now well over 80 chars wide now.
|
|
|
|
| |
Mingw32 has problems with "long long" display so convert to float output.
|
|
|
|
| |
Include the cost-centre-stack ID in the time profiling output.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add a new type of restriction: -hC, which restricts to closures
whose CCS contains the specified CCs *anywhere* (not just at the
top).
- Complain if the user tries to request both retainer and biographical
profiling. We don't support both simultaneously, because they use
the same header word in the closure.
- Allow for the fact that the heap might contain some closures which
don't have a valid retainer set during the heap census. The only
known closures of this kind so far are DEAD_WEAK closures.
- Some cruft-removal and renaming of functions to follow conventions.
|
|
|
|
| |
Don't need the .prof file when LDV-profiling.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Profiling cleanup.
This commit eliminates some duplication in the various heap profiling
subsystems, and generally centralises much of the machinery. The key
concept is the separation of a heap *census* (which is now done in one
place only instead of three) from the calculation of retainer sets.
Previously the retainer profiling code also did a heap census on the
fly, and lag-drag-void profiling had its own census machinery.
Value-adds:
- you can now restrict a heap profile to certain retainer sets,
but still display by cost centre (or type, or closure or
whatever).
- I've added an option to restrict the maximum retainer set size
(+RTS -R<size>, defaulting to 8).
- I've cleaned up the heap profiling options at the request of
Simon PJ. See the help text for details. The new scheme
is backwards compatible with the old.
- I've removed some odd bits of LDV or retainer profiling-specific
code from various parts of the system.
- the time taken doing heap censuses (and retainer set calculation)
is now accurately reported by the RTS when you say +RTS -Sstderr.
Still to come:
- restricting a profile to a particular biography
(lag/drag/void/use). This requires keeping old heap censuses
around, but the infrastructure is now in place to do this.
|
|
|
|
| |
Omit GC and SYSTEM from the cost centre summary at the top of the profile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Retainer Profiling / Lag-drag-void profiling.
This is mostly work by Sungwoo Park, who spent a summer internship at
MSR Cambridge this year implementing these two types of heap profiling
in GHC.
Relative to Sungwoo's original work, I've made some improvements to
the code:
- it's now possible to apply constraints to retainer and LDV profiles
in the same way as we do for other types of heap profile (eg.
+RTS -hc{foo,bar} -hR -RTS gives you a retainer profiling considering
only closures with cost centres 'foo' and 'bar').
- the heap-profile timer implementation is cleaned up.
- heap profiling no longer has to be run in a two-space heap.
- general cleanup of the code and application of the SDM C coding
style guidelines.
Profiling will be a little slower and require more space than before,
mainly because closures have an extra header word to support either
retainer profiling or LDV profiling (you can't do both at the same
time).
We've used the new profiling tools on GHC itself, with moderate
success. Fixes for some space leaks in GHC to follow...
|
|
|
|
|
| |
Add a lightweight arena allocation scheme, and use it to speed up
allocation of cost centres and cost-centre stacks in the profiler.
|
|
|
|
|
| |
Use 'long long' types for the various memory allocation counters in
cost centres and cost centre stacks, as these are prone to overflowing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the story about POSIX headers in C compilation.
Until now, all C code in the RTS and library cbits has by default been
compiled with settings for POSIXness enabled, that is:
#define _POSIX_SOURCE 1
#define _POSIX_C_SOURCE 199309L
#define _ISOC9X_SOURCE
If you wanted to negate this, you'd have to define NON_POSIX_SOURCE
before including headers.
This scheme has some bad effects:
* It means that ccall-unfoldings exported via interfaces from a
module compiled with -DNON_POSIX_SOURCE may not compile when
imported into a module which does not -DNON_POSIX_SOURCE.
* It overlaps with the feature tests we do with autoconf.
* It seems to have caused borkage in the Solaris builds for some
considerable period of time.
The New Way is:
* The default changes to not-being-in-Posix mode.
* If you want to force a C file into Posix mode, #include as
the **first** include the new file ghc/includes/PosixSource.h.
Most of the RTS C sources have this include now.
* NON_POSIX_SOURCE is almost totally expunged. Unfortunately
we have to retain some vestiges of it in ghc/compiler so that
modules compiled via C on Solaris using older compilers don't
break.
|
|
|
|
| |
Adding the -Pa flag. This allows you to see all the cost centres
|
|
|
|
|
|
|
|
|
|
|
|
| |
The time/allocation profile now shows costs as both
- "individual" (incurred by the specific cost-centre stack), and
- "inherited" (incurrent by the cost-centre stack and all its
children).
In addition, the "inner" column has been removed (should be the same
as the sum of the scc counts of the children of the current node), and
the "caf" column has been removed (wasn't very useful).
|
|
|
|
|
| |
- generate the heap profiling into <prog>.hp, as advertised
- clean up RtsFlags a bit
|
|
|
|
|
| |
Ignore system CCSs in the generated XML profile, since the browser
isn't doing this yet.
|
|
|
|
| |
misc profiling cleanups
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- generalise the per-module initialisation stubs so that we use it
in normal (non-profiled) code too. The initialisation stubs are
now called '__init_<module>' rather than '_reg<module>'.
- Register foreign exported functions as stable pointers in the
initialisation code for the module. This fixes the foreign export
problems reported by several people.
- remove the concept of "module groups" from the profiling subsystem.
- change the profiling semantics slightly; it should be unnecessary
to use '-caf-all' to get reasonable profiles now.
|
|
|
|
| |
Remove duplicate prof_file variable. Heap profiling should work again.
|
|
|
|
| |
oops, remove assigment to non-existent "emitted" field in a CCS.
|
|
|
|
|
|
|
|
|
|
|
| |
Change the behaviour of the cost-centre stack profiler for recursive
sccs. Before, we used to remove the old copy of the CC from the stack
and push the new one on. Now, we record back-edges in the graph when
a recursive scc is detected.
This should give saner-looking cost-centre stacks for heavily
recursive code. Indeed, it reduces the number of stacks in the
profile for some examples considerably.
|
|
|
|
|
| |
Fitst cut at XML-style profiling logs. Time/allocation profiling only
for now, and the new flag '+RTS -px' enables the new log file format.
|
|
|
|
| |
Fix call to StgRun
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds in the current state of our SMP support. Notably,
this allows the new way 's' to be built, providing support for running
multiple Haskell threads simultaneously on top of any pthreads
implementation, the idea being to take advantage of commodity SMP
boxes.
Don't expect to get much of a speedup yet; due to the excessive
locking required to synchronise access to mutable heap objects, you'll
see a slowdown in most cases, even on a UP machine. The best I've
seen is a 1.6-1.7 speedup on an example that did no locking (two
optimised nfibs in parallel).
- new RTS -N flag specifies how many pthreads to start.
- new driver -smp flag, tells the driver to use way 's'.
- new compiler -fsmp option (not for user comsumption)
tells the compiler not to generate direct jumps to
thunk entry code.
- largely rewritten scheduler
- _ccall_GC is now done by handing back a "token" to the
RTS before executing the ccall; it should now be possible
to execute blocking ccalls in the current thread while
allowing the RTS to continue running Haskell threads as
normal.
- you can only call thread-safe C libraries from a way 's'
build, of course.
Pthread support is still incomplete, and weird things (including
deadlocks) are likely to happen.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Heap Profiling
--------------
This commit adds simple hp2ps-style heap profiling. Just the '-h'
option is supported so far.
Heap profiles will show the top two cost centres on each cost centre
stack.
Time/Alloc profiles have been extended to aggregate the costs on a
per-cost-centre basis and show the table of highest consuming cost
centres before the full table of cost centre stacks.
Profiles work best if '-caf-all' is used, especially when using
one of the '-auto' flags.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support for thread{WaitRead,WaitWrite,Delay}. These should behave
identically to the 3.02 implementations.
We now have the virtual timer on during all program runs, which ticks
at 50Hz by default. This is used to implement threadDelay, so you
won't get any better granularity than the tick frequency
unfortunately. It remains to be seen whether using the virtual timer
will have a measurable impact on performance for non-threadDelaying
programs.
All operations in the I/O subsystem should now be non-blocking with
respect to other running Haskell threads. It remains to be seen
whether this will have a measurable performance impact on
non-concurrent programs (probably not).
|
|
|
|
|
|
| |
Made the compilation of the RTS almost warning-free and improved the
output of some "barf"s in the garbage collector . This is part of my
epic crusade against "scavenge_mut_list: strange object?"... :-(
|
|
|
|
|
| |
More profiling fixes. Profiles looking more reasonable, but for best
results add the -caf-all switch to GHC.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't set the cost centre when entering a PAP. Either:
- it's fully applied, in which case we're about to
set the CCS in the function anyway, or
- we're about to build another PAP in which case the
costs get attributed to the current CCS.
This avoids appending CCSs twice in some cases.
|
|
|
|
|
|
|
|
|
|
|
| |
Profiling fixes.
- top-level CAF CCSs now *append* themselves to the
current CCS when called.
- remove DICT stuff.
- fixes to the auto-scc annotating in the desugarer.
|
|
|
|
| |
Copyright police.
|
|
Move 4.01 onto the main trunk.
|